Compare commits

2 Commits
Author SHA1 Message Date
Martino Ferrari 05b9490b06 added test run scirpt 2026-11-06 13:42:20 +01:00
Martino FerrariandClaude Opus 4.6 50d85363a3 feat(tcp): TCPStreamer DataSources, in-process TCPStreamService, stream multiplexing and TCPStreamJoin
Add TCPStreamer/TCPStreamerClient (TCP transport behind the UDPSServerI/UDPSClientI
seam), an optional single in-process TCPStreamService serving many streams over
worker threads, multiplexed SUBSCRIBE (comma list, stream index in fragmentIdx),
and TCPStreamJoin, which merges several streams into one sample-and-hold stream
paced by a master. StreamHub takes a comma list of streams over one connection.
Includes GTests, E2E scenarios s58-s73 and docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-11-06 13:41:27 +01:00
81 changed files with 12413 additions and 276 deletions

No files matched your search

+2
View File
@@ -84,6 +84,8 @@ Two independent data paths:
1. **Streaming path**: `UDPStreamer` DataSource serialises signals each RT cycle to UDPS binary packets (UDP 44500, unicast/multicast) → `StreamHub` (`Source/Applications/StreamHub/`, headless C++ app: ring buffers, LTTB decimation, trigger FSM) → WebSocket 8090 → browser (`Client/udpstreamer`, Go), native ImGui client (`Client/streamhub`), or native Qt client (`Client/streamhub-qt`).
2. **Debug path**: `DebugService` patches the `ClassRegistryDatabase` at `Initialise()` so subsequent `ConfigureApplication()` instantiates `DebugBrokerWrapper<T>` around all `MemoryMap*Broker` types — no application changes. RT hot path goes through `DebugServiceI` (abstract singleton in `DebugServiceI.h`) for forcing/tracing/breakpoints. Exposes TCP 8080 (text commands), UDP 8081 (trace telemetry), works with `TcpLogger` on 8082. Web UI: `Client/debugger` (Go).
**TCP variant**: `TCPStreamer` / `TCPStreamerClient` (`Source/Components/DataSources/TCP*`) subclass `UDPStreamer` / `UDPStreamerClient` and swap the transport for `TCPSServer` / `TCPSClient` (`Source/Components/Interfaces/UDPStream/`) through the `UDPSServerI` / `UDPSClientI` seam in `UDPSTransportI.h`. Same UDPS framing (`totalFragments` always 1), per-client bounded queues so a slow client only drops its own frames. `TCPStreamService` (`Source/Components/Interfaces/TCPStreamService/`) is an optional single in-process server (acceptor + worker threads) shared by many `TCPStreamer`s via `Service=`/`StreamName=`; clients pick a stream with a SUBSCRIBE frame (UDPS type 5). A SUBSCRIBE may list several streams (`"a,b"`) to multiplex them over one socket (frames tagged with the stream index in `fragmentIdx`), and `TCPStreamJoin` publishes a merged stream (sample-and-hold of several streams paced by a master). StreamHub sources accept `Transport="tcp"` + `StreamName` (a comma list creates one session per stream). See `Docs/TCPStreamer.md`.
**Shared wire format**: `Common/UDP/UDPSProtocol.h` defines the UDPS binary protocol (17-byte packed header, 136-byte signal descriptors, little-endian). It is deliberately MARTe2-free so it's shared by C++ producers (`UDPStreamer`, `DebugService`), the C++ consumer (`Source/Components/Interfaces/UDPStream/UDPSClient`), the Go decoder (`Common/Client/go/udpsprotocol`), and the standalone C client (`Common/Client/c`, which redeclares the constants rather than including this header, so it stays MARTe-free). Changes to the protocol must be mirrored across all of these, plus the JS client parsers.
**StreamHub WebSocket protocol**: JSON text frames for commands/events, binary frames for data pushes — spec in `ARCHITECTURE.md` §6. The Go hub (`Client/udpstreamer`) and C++ StreamHub implement the identical protocol; both clients (browser JS and ImGui) must stay compatible with both.
+2 -1
View File
@@ -52,7 +52,8 @@ enum {
UDPS_PKT_CONFIG = 1, /**< Server -> client: signal metadata. */
UDPS_PKT_ACK = 2, /**< Client -> server: keepalive. */
UDPS_PKT_CONNECT = 3, /**< Client -> server: open a session. */
UDPS_PKT_DISCONNECT = 4 /**< Either direction: close a session. */
UDPS_PKT_DISCONNECT = 4, /**< Either direction: close a session. */
UDPS_PKT_SUBSCRIBE = 5 /**< Client to TCP stream service only: payload = stream name(s), comma separated; server frames carry the stream index in fragmentIdx. */
};
/** Sample type codes (udps_signal_t::type_code). */
@@ -18,6 +18,7 @@ const (
PktACK uint8 = 2
PktConnect uint8 = 3
PktDisconnect uint8 = 4
PktSubscribe uint8 = 5 // TCP stream service only: payload = stream name(s), comma separated; server frames carry the stream index in fragmentIdx
HeaderSize = 17
SigDescSize = 136
+8
View File
@@ -61,6 +61,14 @@ static const uint8 UDPS_TYPE_CONFIG = 1u; ///< Server → Client: signal con
static const uint8 UDPS_TYPE_ACK = 2u; ///< Client → Server: ack counter
static const uint8 UDPS_TYPE_CONNECT = 3u; ///< Client → Server: connect request
static const uint8 UDPS_TYPE_DISCONNECT = 4u; ///< Client → Server: disconnect
static const uint8 UDPS_TYPE_SUBSCRIBE = 5u; ///< Client → Server (TCP stream service only): payload = stream name(s), comma separated
/** TCP stream service: most streams one connection may multiplex. On such a
* connection every server frame carries the stream's position in the SUBSCRIBE
* list in the header's fragmentIdx field (totalFragments stays 1). */
static const uint32 UDPS_TCP_MAX_STREAMS = 64u;
/** TCP stream service: longest SUBSCRIBE payload (comma separated names, each <= 255). */
static const uint32 UDPS_TCP_MAX_SUBSCRIBE_PAYLOAD = 4096u;
/*---------------------------------------------------------------------------*/
/* Wire packet header (17 bytes) */
+1
View File
@@ -37,6 +37,7 @@ Offset Size Type Field
| 2 | Client → Server | ACK | Acknowledge a data counter (reserved) |
| 3 | Client → Server | CONNECT | Request a session |
| 4 | Client → Server | DISCONNECT | End the session |
| 5 | Client → Server | SUBSCRIBE | TCP only: select a stream of a `TCPStreamService` (payload = stream name, 1..255 bytes, or a comma separated list of up to 64 names to multiplex; each server frame then carries its stream's list index in `fragmentIdx`) |
---
+204
View File
@@ -0,0 +1,204 @@
# TCPStreamer / TCPStreamerClient
TCP counterparts of `UDPStreamer` / `UDPStreamerClient`. Same signals,
quantisation, time modes, publishing modes and UDPS wire format; only the
transport differs. Use them when you need lossless, ordered delivery to a few
consumers and do not need multicast.
## How it works
- `TCPStreamer` derives from `UDPStreamer`; `TCPStreamerClient` from
`UDPStreamerClient`. They install a `TCPSServer` / `TCPSClient` through the
`UDPSServerI` / `UDPSClientI` interfaces (`UDPSTransportI.h`), so the RT path
(`Synchronise()` = spinlock + memcpy) and serialisation are shared.
- Frames are UDPS frames (17-byte header + payload) on the byte stream, with
`totalFragments` always 1. The server sends CONFIG on accept; there is no
CONNECT / ACK / keepalive.
- Each client has its own bounded queue (`ClientQueueDepth` DATA frames plus
CONFIG slots). If a client cannot keep up, only its own oldest DATA frames
are dropped (counted by `GetClientDrops()`, logged at most once per second).
A client with no progress for `ClientStallTimeout` seconds is disconnected.
The RT thread and other clients are never affected.
- A new CONFIG (reconfiguration) discards the client's stale queued DATA.
- The client reconnects automatically after any disconnect or protocol error
(bad magic, oversize length, fragmented frame).
## TCPStreamer configuration
All `UDPStreamer` keys apply (see `UDPStreamer.md`) except the UDP-only
`MulticastGroup`, `Interface`, `DataPort`, `ClientTimeout`, which are rejected.
| Key | Default | Meaning |
|---|---|---|
| `Port` | 44500 | TCP listen port (0 = ephemeral, see `GetBoundPort()`) |
| `MaxPayloadSize` | 60000 | Frame budget; sizes Accumulate batches. Frames up to 1 MiB are sent |
| `MaxClients` | 16 | Simultaneous clients (1..1024); extra connections are closed |
| `ClientQueueDepth` | 8 | DATA frames queued per client (1..4096) |
| `ClientStallTimeout` | 5 | Seconds without progress before disconnect; 0 disables |
| `SendBufferSize` | 0 | `SO_SNDBUF` for client sockets; 0 keeps the OS default |
Accessors: `GetBoundPort()`, `GetClientCount()`, `GetClientDrops()`,
`GetStallEvictions()`, plus the inherited `GetDroppedPublications()`.
```
+Streamer = {
Class = TCPStreamer
Port = 44500
ClientQueueDepth = 16
Signals = {
Time = { Type = uint64 }
Value = { Type = float32 }
}
}
```
## TCPStreamerClient configuration
| Key | Default | Meaning |
|---|---|---|
| `ServerAddress` | 127.0.0.1 | Server IPv4 address or host name |
| `Port` | 44500 | Server TCP port |
| `SilenceTimeout` | 0 | Seconds without any byte before reconnecting; 0 disables |
| `ReconnectDelay` | 2 | Seconds between connection attempts |
| `CPUMask`, `StackSize` | default | Receiver thread |
`MulticastGroup`, `DataPort`, `Interface`, `KeepAliveInterval` are rejected.
Accessors: `IsConnected()`, `GetConnectionCount()`, `GetProtocolErrors()`.
The client delivers frames as received; it does no gap or stale-packet
handling.
## Service mode: one in-process server, many streams
`TCPStreamService` is a root-level object that owns the listening socket and a
pool of worker threads. Any number of `TCPStreamer` DataSources (each on its own
real-time thread) publish into it; clients choose a stream by name.
```
+Svc = { Class = TCPStreamService Port = 44500 Workers = 2 }
...
+Fast = { Class = TCPStreamer Service = "Svc" StreamName = "fast" Signals = { ... } }
+Slow = { Class = TCPStreamer Service = "Svc" StreamName = "slow" Signals = { ... } }
+Rx = { Class = TCPStreamerClient Port = 44500 StreamName = "fast" Signals = { ... } }
```
- Wire protocol: plain UDPS over TCP plus one client-to-server frame,
`SUBSCRIBE` (type 5, payload = stream name, 1..255 bytes, or a comma separated
list, see "Joining streams"). The service answers with that stream's CONFIG
and then its DATA frames. A connection that does not subscribe within `HandshakeTimeout`, or
names an unknown stream, is closed (the client reconnects).
- Threads: one acceptor plus `Workers` I/O threads; each connection lives on one
worker. Producers only copy frames into per-connection bounded queues
(drop-oldest) and wake the worker through a self-pipe, so a slow client never
delays a producer or another client. Lock order: topology, stream, connection.
- A stream registers at `Start()` (looked up with
`ObjectRegistryDatabase::Find(Service)`) and unregisters on stop.
- `StreamName` defaults to the DataSource name (max 255 chars). In service mode
`Port`, `MaxClients`, `ClientQueueDepth`, `ClientStallTimeout` and
`SendBufferSize` belong to the service and are rejected on the streamer.
- `TCPStreamerClient` / `TCPSClient` send SUBSCRIBE after every (re)connect when
`StreamName` is set. A plain `TCPSServer` ignores it, so the same client works
against both.
`TCPStreamService` keys:
| Key | Default | Meaning |
|---|---|---|
| `Port` | 44500 | TCP listen port |
| `Workers` | 2 | I/O threads (1..32) |
| `MaxClients` | 64 | Total simultaneous clients (1..1024) |
| `MaxStreams` | 32 | Streams that can register (1..256) |
| `ClientQueueDepth` | 8 | DATA frames queued per client (1..4096) |
| `ClientStallTimeout` | 5 | Seconds without progress before eviction; 0 disables |
| `HandshakeTimeout` | 5 | Seconds a new connection has to SUBSCRIBE (>= 1) |
| `SendBufferSize` | 0 | `SO_SNDBUF`; 0 keeps the OS default |
| `CPUMask`, `StackSize` | default | Worker threads |
## Joining streams
Two independent ways to take several service streams through one cheaper path.
### Multiplexed connection
`SUBSCRIBE` may carry a comma separated list (`"fast,slow"`; at most 64 names,
4096 payload bytes, no duplicates, no `,` in a stream name). One socket then
carries every listed stream, each keeping its own CONFIG, rate and timeline:
- The index of a stream is its position in the list; every server frame carries
it in `fragmentIdx` (`totalFragments` stays 1). A single name is index 0, so
existing clients are unchanged. One unknown name closes the connection.
- Queues are accounted per stream: `ClientQueueDepth` DATA frames *per stream*,
drop-oldest within the same stream only, so a fast stream never evicts a slow
stream's frames. Queued frames are written with one `sendmsg` (up to 16).
- `TCPSClient` accepts `StreamName = "a,b,c"`, demultiplexes by `fragmentIdx`
(`SetStreamListener(i, ...)`) and tracks the counter gap per stream.
`GetStream(i)` returns a `UDPSClientI` facade whose `Start()`/`Stop()` are
reference counted on the shared connection. `TCPStreamerClient` is
single-stream and rejects a comma.
- `GetClientCount()` of a service counts (connection, stream) subscriptions.
### Merged stream: `TCPStreamJoin`
```
+Svc = { Class = TCPStreamService Port = 44500 }
+Fast = { Class = TCPStreamer Service = "Svc" StreamName = "fast" ... }
+Slow = { Class = TCPStreamer Service = "Svc" StreamName = "slow" ... }
+Join = { Class = TCPStreamJoin Service = "Svc" StreamName = "all"
Sources = "fast,slow" Master = "fast" }
```
A root-level object, declared after the service, that publishes a new stream
`all` holding the signals of several streams of the same service:
- CONFIG: source descriptors concatenated in `Sources` order, named
`<stream>_<signal>` (at most 63 characters), `timeSignalIdx` rebased, publish
mode Strict, one HRT frequency (sources with different known frequencies are
refused; an unknown one matches any).
- DATA: one frame per `Master` frame, `[master timestamp][source0 body][source1
body]...`, a body being that source's last DATA payload without its 8-byte
timestamp (sample-and-hold). Nothing is emitted until every source has
delivered one frame. A held value is stamped with the master's time unless the
source has a time signal. No thread is added: the frame is built on the master
producer's thread.
- Only Strict and Decimate sources can be merged; a source whose body size
changes without a new CONFIG is ignored; the merged frame must fit
`MaxPayloadSize` (default 60000).
- The merged stream is registered while every source is registered, removed as
soon as one leaves (its subscribers are dropped and reconnect) and rebuilt when
a source re-registers or changes its CONFIG. A source with a join attached
keeps publishing even with no socket subscriber.
- Keys: `Service` (required), `StreamName` (default object name), `Sources`
(required, 1..16), `Master` (default first source), `MaxPayloadSize`.
Design: `docs/superpowers/specs/2026-11-06-tcp-stream-join-design.md`.
## StreamHub
A StreamHub source can consume over TCP: in the config `Sources` block (and in
`addSource` / the `SourcesFile`) set `Transport = "tcp"` (default `"udp"`) and,
for a service, `StreamName = "<stream>"`. `Addr` is then the TCP server
address. The hub uses `TCPSClient`, which reports the UDPS counter gap so the
accumulate-mode timing estimator tolerates dropped frames.
`StreamName = "a,b,c"` takes several streams over one multiplexed connection and
creates one session per stream, labelled `<Label>_<stream>` (just the stream
name without a label). Session ids are `<node>_<stream>` for a config `Sources`
node and `s<N>` for `addSource`.
## Tests
- GTest: `Test/GTest/TCPSServerGTest.cpp`, `TCPSClientGTest.cpp`,
`TCPStreamerGTest.cpp` (helpers in `TCPTestUtil.h`) and
`TCPStreamServiceGTest.cpp` (queue, protocol, multiplexing, joins,
multi-stream/worker, stalls).
- E2E (`Test/E2E/suite/scenarios.py`): `s58_direct_tcp`, `s59_direct_tcp_service`
(FileReader to FileWriter round trip) and chain scenarios `s60`-`s65` (plain
TCP: scalar, full array, accumulate, decimate/quantise, multi-source,
high rate), `s66`-`s71` (service: same features plus 3- and 6-stream
fan-in), `s72` (hub on one multiplexed connection) and `s73` (merged stream). Scenario configs are generated by `gen_cfg.py`
(`network = "tcp"` / `"tcp_service"`).
## Design
`docs/superpowers/specs/2026-11-05-tcp-streamer-design.md` (section 7 covers
the single-service design implemented by `TCPStreamService`).
+6
View File
@@ -18,6 +18,9 @@ core:
$(MAKE) -C Source/Components/Interfaces/UDPStream -f Makefile.gcc
$(MAKE) -C Source/Components/DataSources/UDPStreamer -f Makefile.gcc
$(MAKE) -C Source/Components/DataSources/UDPStreamerClient -f Makefile.gcc
$(MAKE) -C Source/Components/Interfaces/TCPStreamService -f Makefile.gcc
$(MAKE) -C Source/Components/DataSources/TCPStreamer -f Makefile.gcc
$(MAKE) -C Source/Components/DataSources/TCPStreamerClient -f Makefile.gcc
$(MAKE) -C Source/Components/GAMs/SineArrayGAM -f Makefile.gcc
$(MAKE) -C Source/Components/GAMs/TimeArrayGAM -f Makefile.gcc
$(MAKE) -C Source/Components/Interfaces/TCPLogger -f Makefile.gcc
@@ -35,6 +38,9 @@ clean:
$(MAKE) -C Source/Components/Interfaces/UDPStream -f Makefile.gcc clean
$(MAKE) -C Source/Components/DataSources/UDPStreamer -f Makefile.gcc clean
$(MAKE) -C Source/Components/DataSources/UDPStreamerClient -f Makefile.gcc clean
$(MAKE) -C Source/Components/Interfaces/TCPStreamService -f Makefile.gcc clean
$(MAKE) -C Source/Components/DataSources/TCPStreamer -f Makefile.gcc clean
$(MAKE) -C Source/Components/DataSources/TCPStreamerClient -f Makefile.gcc clean
$(MAKE) -C Source/Components/GAMs/SineArrayGAM -f Makefile.gcc clean
$(MAKE) -C Source/Components/GAMs/TimeArrayGAM -f Makefile.gcc clean
$(MAKE) -C Source/Components/Interfaces/TCPLogger -f Makefile.gcc clean
+202 -8
View File
@@ -92,6 +92,7 @@ StreamHub::StreamHub()
memset(calibration_, 0, sizeof(CalibrationEntry) * kMaxCalibration);
for (uint32 i = 0u; i < kMaxSessions; i++) {
sessionActive_[i] = false;
sessionMux_[i] = -1;
configBroadcast_[i] = false;
capHarvested_[i] = false;
for (uint32 s = 0u; s < UDPSS_MAX_SIGNALS; s++) {
@@ -273,11 +274,33 @@ bool StreamHub::Initialise(StructuredDataI &cfg) {
}
cfg.Read("DataPort", dataPort32);
char transport[8] = "udp";
char streamName[256] = "";
StreamString trStr;
if (cfg.Read("Transport", trStr)) {
strncpy(transport, trStr.Buffer(), sizeof(transport) - 1u);
}
StreamString snStr;
if (cfg.Read("StreamName", snStr)) {
strncpy(streamName, snStr.Buffer(), sizeof(streamName) - 1u);
}
if ((strcmp(transport, "tcp") == 0) && (strchr(streamName, ',') != static_cast<char *>(0))) {
/* Several streams over one connection: slots are allocated by the helper. */
if (!AddMuxSourceInternal(label, addr, port32, addr, streamName, nodeId.Buffer())) {
REPORT_ERROR_STATIC(MARTe::ErrorManagement::Warning,
"StreamHub: failed to start multiplexed source '%s'.", nodeId.Buffer());
}
cfg.MoveToAncestor(1u);
continue;
}
sessions_[numSessions_].SetRingCapacities(ringTemporal_, ringScalar_);
bool ok = sessions_[numSessions_].Initialise(
nodeId.Buffer(), label, addr,
static_cast<uint16>(port32), maxPoints_,
mcGroup, static_cast<uint16>(dataPort32));
mcGroup, static_cast<uint16>(dataPort32),
transport, streamName);
if (ok) {
sessions_[numSessions_].SetRecorderConfig(recorderCfg_);
@@ -1201,15 +1224,20 @@ void StreamHub::HandleAddSource(const char *json) {
JsonGetString(json, "addr", addr, sizeof(addr));
JsonGetString(json, "multicastGroup", mcGroup, sizeof(mcGroup));
JsonGetFloat(json, "dataPort", dataPortF);
char transport[8] = "udp";
char streamName[256] = "";
JsonGetString(json, "transport", transport, sizeof(transport));
JsonGetString(json, "streamName", streamName, sizeof(streamName));
if (AddSourceInternal(label, addr, mcGroup,
static_cast<uint16>(dataPortF))) {
static_cast<uint16>(dataPortF), transport, streamName)) {
BroadcastSources();
}
}
bool StreamHub::AddSourceInternal(const char *label, const char *addrPort,
const char *mcGroup, uint16 dataPort) {
const char *mcGroup, uint16 dataPort,
const char *transport, const char *streamName) {
if ((addrPort == static_cast<const char *>(0)) || (addrPort[0] == '\0')) {
return false;
}
@@ -1226,6 +1254,12 @@ bool StreamHub::AddSourceInternal(const char *label, const char *addrPort,
*colon = '\0';
}
if ((transport != static_cast<const char *>(0)) && (strcmp(transport, "tcp") == 0) &&
(streamName != static_cast<const char *>(0)) &&
(strchr(streamName, ',') != static_cast<const char *>(0))) {
return AddMuxSourceInternal(label, host, port, addrPort, streamName);
}
/* Whole add is serialized against other WS-thread add/remove requests.
* The push thread never takes this mutex: it only observes the
* sessionActive_[] flag, which is set last (after a successful Start). */
@@ -1256,7 +1290,7 @@ bool StreamHub::AddSourceInternal(const char *label, const char *addrPort,
sessions_[idx].SetRingCapacities(ringTemporal_, ringScalar_);
bool ok = sessions_[idx].Initialise(id, lbl, host,
static_cast<uint16>(port), maxPoints_,
mcGroup, dataPort);
mcGroup, dataPort, transport, streamName);
if (ok) {
sessions_[idx].SetRecorderConfig(recorderCfg_);
ok = sessions_[idx].Start();
@@ -1275,14 +1309,151 @@ bool StreamHub::AddSourceInternal(const char *label, const char *addrPort,
return ok;
}
bool StreamHub::SourceIsActive(const char *addrPort) {
bool StreamHub::AddMuxSourceInternal(const char *label, const char *host, uint32 port,
const char *addrPort, const char *streamList,
const char *idPrefix) {
char list[MARTe::UDPS_TCP_MAX_SUBSCRIBE_PAYLOAD + 1u];
strncpy(list, streamList, sizeof(list) - 1u);
list[sizeof(list) - 1u] = '\0';
const char *names[kMaxSessions];
uint32 n = 0u;
char *cur = list;
while (cur != static_cast<char *>(0)) {
char *comma = strchr(cur, ',');
if (comma != static_cast<char *>(0)) { *comma = '\0'; }
if ((cur[0] == '\0') || (n >= kMaxSessions)) {
REPORT_ERROR_STATIC(MARTe::ErrorManagement::Warning,
"StreamHub: bad stream list '%s' (empty name or more than %u streams).",
streamList, kMaxSessions);
return false;
}
names[n++] = cur;
cur = (comma != static_cast<char *>(0)) ? (comma + 1) : static_cast<char *>(0);
}
(void) sessionsMutex_.FastLock();
uint32 slots[kMaxSessions];
uint32 found = 0u;
for (uint32 i = 0u; (i < kMaxSessions) && (found < n); i++) {
if (!sessionActive_[i]) { slots[found++] = i; }
}
uint32 mux = kMaxSessions;
for (uint32 i = 0u; i < kMaxSessions; i++) {
if (muxClients_[i].client == static_cast<MARTe::TCPSClient *>(0)) { mux = i; break; }
}
if ((found < n) || (mux == kMaxSessions)) {
sessionsMutex_.FastUnLock();
REPORT_ERROR_STATIC(MARTe::ErrorManagement::Warning,
"StreamHub: not enough free sessions for %u streams, ignoring addSource.", n);
return false;
}
MARTe::TCPSClient *client = new MARTe::TCPSClient();
ConfigurationDatabase cfg;
(void) cfg.Write("ServerAddr", host);
(void) cfg.Write("Port", port);
(void) cfg.Write("StreamName", streamList);
bool ok = client->Initialise(cfg) && (client->GetNumStreams() == n);
if (!ok) {
delete client;
sessionsMutex_.FastUnLock();
REPORT_ERROR_STATIC(MARTe::ErrorManagement::Warning,
"StreamHub: could not set up the multiplexed receiver for '%s'.", streamList);
return false;
}
muxClients_[mux].client = client;
muxClients_[mux].refs = 0u;
const char *base = ((label != static_cast<const char *>(0)) && (label[0] != '\0')) ? label
: static_cast<const char *>(0);
/* Initialise every session (listeners attached) before any can receive. */
uint32 initialised = 0u;
for (uint32 k = 0u; (k < n) && ok; k++) {
const uint32 idx = slots[k];
char id[16 + 256];
if (idPrefix != static_cast<const char *>(0)) {
snprintf(id, sizeof(id), "%s_%s", idPrefix, names[k]);
} else {
snprintf(id, sizeof(id), "s%u", nextSourceId_++);
}
char lbl[160];
if (base != static_cast<const char *>(0)) {
snprintf(lbl, sizeof(lbl), "%s_%s", base, names[k]);
} else {
snprintf(lbl, sizeof(lbl), "%s", names[k]);
}
configBroadcast_[idx] = false;
for (uint32 s = 0u; s < UDPSS_MAX_SIGNALS; s++) { pushCursor_[idx][s] = 0u; }
sessions_[idx].SetRingCapacities(ringTemporal_, ringScalar_);
ok = sessions_[idx].Initialise(id, lbl, host, static_cast<uint16>(port), maxPoints_,
"", 0u, "tcp", names[k], client->GetStream(k));
if (ok) {
sessionMux_[idx] = static_cast<MARTe::int32>(mux);
muxClients_[mux].refs++;
initialised++;
}
}
for (uint32 k = 0u; (k < initialised) && ok; k++) {
sessions_[slots[k]].SetRecorderConfig(recorderCfg_);
ok = sessions_[slots[k]].Start();
}
if (ok) {
for (uint32 k = 0u; k < n; k++) {
sessionActive_[slots[k]] = true;
numSessions_++;
}
} else {
for (uint32 k = 0u; k < initialised; k++) { ReleaseMuxSlot(slots[k]); }
if (muxClients_[mux].client != static_cast<MARTe::TCPSClient *>(0)) {
delete muxClients_[mux].client; /* no session ever attached */
muxClients_[mux].client = static_cast<MARTe::TCPSClient *>(0);
}
}
sessionsMutex_.FastUnLock();
if (ok) {
REPORT_ERROR_STATIC(MARTe::ErrorManagement::Information,
"StreamHub: added %u multiplexed sessions over one connection (%s).", n, addrPort);
}
return ok;
}
void StreamHub::ReleaseMuxSlot(uint32 slot) {
/* Caller holds sessionsMutex_. */
if (sessionMux_[slot] < 0) { return; }
const uint32 m = static_cast<uint32>(sessionMux_[slot]);
sessions_[slot].DetachClient();
sessionMux_[slot] = -1;
if ((muxClients_[m].refs > 0u) && (--muxClients_[m].refs == 0u)) {
delete muxClients_[m].client;
muxClients_[m].client = static_cast<MARTe::TCPSClient *>(0);
}
}
bool StreamHub::SourceIsActive(const char *addrPort, const char *streamName) {
if (strchr(streamName, ',') != static_cast<const char *>(0)) {
/* A list is active when every stream of it is. */
char list[MARTe::UDPS_TCP_MAX_SUBSCRIBE_PAYLOAD + 1u];
strncpy(list, streamName, sizeof(list) - 1u);
list[sizeof(list) - 1u] = '\0';
bool all = true;
char *cur = list;
while (all && (cur != static_cast<char *>(0))) {
char *comma = strchr(cur, ',');
if (comma != static_cast<char *>(0)) { *comma = '\0'; }
all = SourceIsActive(addrPort, cur);
cur = (comma != static_cast<char *>(0)) ? (comma + 1) : static_cast<char *>(0);
}
return all;
}
for (uint32 i = 0u; i < kMaxSessions; i++) {
if (!sessionActive_[i]) { continue; }
StreamString adr = sessions_[i].GetAddr();
char cur[96];
(void) snprintf(cur, sizeof(cur), "%s:%u", adr.Buffer(),
static_cast<uint32>(sessions_[i].GetPort()));
if (strcmp(cur, addrPort) == 0) { return true; }
StreamString sn = sessions_[i].GetStreamName();
if ((strcmp(cur, addrPort) == 0) && (strcmp(sn.Buffer(), streamName) == 0)) { return true; }
}
return false;
}
@@ -1335,11 +1506,16 @@ bool StreamHub::LoadSourcesFile(bool skipActive, bool clearCalibration) {
(void) JsonGetString(obj, "label", label, sizeof(label));
(void) JsonGetString(obj, "multicastGroup", mcGroup, sizeof(mcGroup));
(void) JsonGetFloat(obj, "dataPort", dataPortF);
if (skipActive && SourceIsActive(addr)) {
char transport[8] = "udp";
char streamName[256] = "";
(void) JsonGetString(obj, "transport", transport, sizeof(transport));
(void) JsonGetString(obj, "streamName", streamName, sizeof(streamName));
if (skipActive && SourceIsActive(addr, streamName)) {
/* Already streaming — leave the live session untouched. */
}
else if (AddSourceInternal(label, addr, mcGroup,
static_cast<uint16>(dataPortF))) {
static_cast<uint16>(dataPortF),
transport, streamName)) {
nLoaded++;
}
}
@@ -1414,6 +1590,14 @@ void StreamHub::HandleSaveSources() {
static_cast<uint32>(dpt));
}
}
StreamString trn = sessions_[i].GetTransport();
if (strcmp(trn.Buffer(), "tcp") == 0) {
(void) fprintf(f, ",\n \"transport\": \"tcp\"");
StreamString sn = sessions_[i].GetStreamName();
if (sn.Size() > 0u) {
(void) fprintf(f, ",\n \"streamName\": \"%s\"", sn.Buffer());
}
}
(void) fprintf(f, "\n }");
nSaved++;
}
@@ -1500,16 +1684,26 @@ void StreamHub::HandleRemoveSource(const char *json) {
break;
}
}
bool shared = false;
if (found < kMaxSessions) {
sessionActive_[found] = false;
configBroadcast_[found] = false; /* allow re-broadcast on slot reuse */
numSessions_--;
if (sessionMux_[found] >= 0) {
/* One stream of a shared receiver: stop it and drop its listener
* under the lock, so the slot cannot be reused underneath. */
sessions_[found].Stop();
ReleaseMuxSlot(found);
shared = true;
}
}
sessionsMutex_.FastUnLock();
if (found == kMaxSessions) { return; }
if (!shared) {
sessions_[found].Stop();
}
REPORT_ERROR_STATIC(MARTe::ErrorManagement::Information,
"StreamHub: removed session '%s'.", id);
+34 -3
View File
@@ -231,11 +231,27 @@ private:
* @return true if the session was started.
*/
bool AddSourceInternal(const char *label, const char *addrPort,
const char *mcGroup, uint16 dataPort);
const char *mcGroup, uint16 dataPort,
const char *transport = "udp",
const char *streamName = "");
/**
* @brief TCP source whose streamName is a comma separated list "a,b,c": one
* TCPSClient (one socket) feeds one session per stream, labelled
* "<label>_<stream>" (just "<stream>" without a label). Session ids are
* "s<N>", or "<idPrefix>_<stream>" when @p idPrefix (the config node id) is given.
* @return true if every session was started (none is left behind otherwise).
*/
bool AddMuxSourceInternal(const char *label, const char *host, uint32 port,
const char *addrPort, const char *streamList,
const char *idPrefix = static_cast<const char *>(0));
/** @brief Detach @p slot from its shared receiver; frees the receiver with its last session. */
void ReleaseMuxSlot(uint32 slot);
/**
* @brief Load sources and calibration from sourcesFile_ (a flat JSON array
* of {"label","addr","multicastGroup","dataPort"} source blocks and
* of {"label","addr","multicastGroup","dataPort","transport","streamName"} source blocks and
* {"source","signal","scale","offset","unit"} calibration blocks).
* @param skipActive when true, a source whose "host:port" is already
* streaming is left alone instead of being started a second time.
@@ -247,7 +263,7 @@ private:
bool LoadSourcesFile(bool skipActive, bool clearCalibration = false);
/** @return true if a session for this "host:port" is already active. */
bool SourceIsActive(const char *addrPort);
bool SourceIsActive(const char *addrPort, const char *streamName = "");
/**
* @brief Store or replace one calibration entry. An identity entry
@@ -280,6 +296,21 @@ private:
/* ---- Members --------------------------------------------------------- */
/** A multiplexed receiver shared by several sessions (deleted with the last one). */
struct MuxClient {
MuxClient() : client(static_cast<MARTe::TCPSClient *>(0)), refs(0u) {}
~MuxClient() { delete client; }
MARTe::TCPSClient *client;
uint32 refs;
private:
MuxClient(const MuxClient &);
MuxClient &operator=(const MuxClient &);
};
/* Declared before sessions_ so it is destroyed after them: a session stops
* its (facade of a) shared receiver from its own destructor. */
MuxClient muxClients_[kMaxSessions];
MARTe::int32 sessionMux_[kMaxSessions]; ///< Index into muxClients_, or -1
UDPSourceSession sessions_[kMaxSessions];
uint32 numSessions_; ///< Count of active sessions (not an upper slot bound)
bool sessionActive_[kMaxSessions]; ///< Per-slot in-use flag (slots are not compacted on removal)
@@ -51,6 +51,8 @@ UDPSourceSession::UDPSourceSession()
ringTemporal_(1000000u),
ringScalar_(100000u),
initialised_(false),
client_(static_cast<MARTe::UDPSClientI *>(0)),
external_(false),
numSignals_(0u),
publishMode_(0u),
configured_(false),
@@ -112,7 +114,10 @@ bool UDPSourceSession::Initialise(const char *id, const char *label,
const char *addr, uint16 port,
uint32 maxPts,
const char *mcGroup,
uint16 dataPort) {
uint16 dataPort,
const char *transport,
const char *streamName,
MARTe::UDPSClientI *external) {
(void) Stop();
id_ = id;
@@ -121,25 +126,42 @@ bool UDPSourceSession::Initialise(const char *id, const char *label,
port_ = port;
mcGroup_ = (mcGroup != static_cast<const char *>(0)) ? mcGroup : "";
dataPort_ = dataPort;
transport_ = ((transport != static_cast<const char *>(0)) && (strcmp(transport, "tcp") == 0)) ? "tcp" : "udp";
streamName_ = (streamName != static_cast<const char *>(0)) ? streamName : "";
maxPoints_ = (maxPts > 0u) ? maxPts : 20000u;
/* Build ConfigurationDatabase for UDPSClient */
ConfigurationDatabase cfg;
(void) cfg.Write("ServerAddr", addr);
(void) cfg.Write("Port", static_cast<uint32>(port));
if ((mcGroup != static_cast<const char *>(0)) && (strlen(mcGroup) > 0u)) {
const bool useTcp = (transport_ == "tcp");
if (useTcp) {
if (streamName_.Size() > 0u) {
(void) cfg.Write("StreamName", streamName_.Buffer());
}
} else if ((mcGroup != static_cast<const char *>(0)) && (strlen(mcGroup) > 0u)) {
(void) cfg.Write("MulticastGroup", mcGroup);
if (dataPort > 0u) {
(void) cfg.Write("DataPort", static_cast<uint32>(dataPort));
}
}
if (!client_.Initialise(cfg)) {
external_ = (external != static_cast<MARTe::UDPSClientI *>(0));
if (external_) {
client_ = external; /* already configured by its owner */
}
else {
client_ = useTcp ? static_cast<MARTe::UDPSClientI *>(&tcpClient_)
: static_cast<MARTe::UDPSClientI *>(&udpClient_);
}
if (!external_ && !client_->Initialise(cfg)) {
REPORT_ERROR_STATIC(MARTe::ErrorManagement::FatalError,
"UDPSourceSession[%s]: Failed to initialise UDPSClient.", id);
"UDPSourceSession[%s]: Failed to initialise %s client.",
id, useTcp ? "TCPSClient" : "UDPSClient");
client_ = static_cast<MARTe::UDPSClientI *>(0);
return false;
}
client_.SetListener(this);
client_->SetListener(this);
(void) metaMutex_.FastLock();
numSignals_ = 0u;
@@ -165,12 +187,22 @@ bool UDPSourceSession::Start() {
statByteCount_ = 0u;
stateStr_ = "connecting";
statsMutex_.FastUnLock();
return client_.Start();
return client_->Start();
}
void UDPSourceSession::DetachClient() {
if (!external_) { return; }
(void) Stop();
if (client_ != static_cast<MARTe::UDPSClientI *>(0)) {
client_->SetListener(static_cast<MARTe::UDPSClientListener *>(0));
}
client_ = static_cast<MARTe::UDPSClientI *>(0);
external_ = false;
}
bool UDPSourceSession::Stop() {
if (!initialised_) { return true; }
return client_.Stop();
if (!initialised_ || (client_ == static_cast<MARTe::UDPSClientI *>(0))) { return true; }
return client_->Stop();
}
/*---------------------------------------------------------------------------*/
@@ -200,7 +232,7 @@ void UDPSourceSession::OnUDPSConfig(const uint8 *payload, uint32 payloadSize) {
void UDPSourceSession::OnUDPSData(const uint8 *payload, uint32 payloadSize) {
/* Valid only for the duration of this callback. */
ParseDataPayload(payload, payloadSize, client_.GetLastDataGap());
ParseDataPayload(payload, payloadSize, client_->GetLastDataGap());
}
/*---------------------------------------------------------------------------*/
@@ -947,6 +979,10 @@ StreamString UDPSourceSession::GetMulticastGroup() const { return mcGroup_; }
uint16 UDPSourceSession::GetDataPort() const { return dataPort_; }
StreamString UDPSourceSession::GetTransport() const { return transport_; }
StreamString UDPSourceSession::GetStreamName() const { return streamName_; }
bool UDPSourceSession::IsConfigured() const {
(void) metaMutex_.FastLock();
bool c = configured_;
@@ -11,6 +11,7 @@
#define STREAMHUB_UDP_SOURCE_SESSION_H_
#include "UDPSClient.h"
#include "TCPSClient.h"
#include "UDPSProtocol.h"
#include "FastPollingMutexSem.h"
#include "HighResolutionTimer.h"
@@ -158,11 +159,23 @@ public:
* @param maxPts Ring buffer capacity per signal.
* @param mcGroup Multicast group (empty string = unicast).
* @param dataPort Multicast data port (0 = port+1).
* @param transport "udp" (default) or "tcp". TCP ignores mcGroup/dataPort.
* @param streamName TCP only: stream to subscribe to on a TCPStreamService
* ("" = plain TCPStreamer, no subscription).
* @param external Optional receiver owned by the caller (one stream of a
* multiplexed TCPSClient, see TCPSClient::GetStream()). When set the
* session does not create or configure its own client; call
* DetachClient() before the receiver is destroyed.
* @return true on success.
*/
bool Initialise(const char *id, const char *label,
const char *addr, uint16 port, uint32 maxPts,
const char *mcGroup = "", uint16 dataPort = 0u);
const char *mcGroup = "", uint16 dataPort = 0u,
const char *transport = "udp", const char *streamName = "",
MARTe::UDPSClientI *external = static_cast<MARTe::UDPSClientI *>(0));
/** @brief Stop and forget an external receiver (no-op for built-in receivers). */
void DetachClient();
/** @brief Start the UDPSClient background thread. */
bool Start();
@@ -236,6 +249,12 @@ public:
/** @return Multicast data port (0 = port+1 default). */
uint16 GetDataPort() const;
/** @return "udp" or "tcp". */
StreamString GetTransport() const;
/** @return TCP stream name ("" = none). */
StreamString GetStreamName() const;
/** @return true after the first CONFIG packet has been fully parsed. */
bool IsConfigured() const;
@@ -443,13 +462,18 @@ private:
uint16 port_;
StreamString mcGroup_; ///< Multicast group ("" = unicast)
uint16 dataPort_; ///< Multicast data port (0 = port+1)
StreamString transport_; ///< "udp" or "tcp"
StreamString streamName_;///< TCPStreamService stream name ("" = none)
uint32 maxPoints_;
uint32 ringTemporal_; ///< Ring capacity for multi-element signals
uint32 ringScalar_; ///< Ring capacity for scalar signals
bool initialised_;
/* UDPSClient (owns the background thread) */
UDPSClient client_;
/* Receivers (each owns a background thread); client_ points at the active one. */
UDPSClient udpClient_;
MARTe::TCPSClient tcpClient_;
MARTe::UDPSClientI *client_;
bool external_; ///< client_ is owned by the caller
/* Signal metadata — protected by metaMutex_ */
mutable FastPollingMutexSem metaMutex_;
@@ -0,0 +1,25 @@
#############################################################
#
# Copyright 2015 F4E | European Joint Undertaking for ITER
# and the Development of Fusion Energy ('Fusion for Energy')
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (the "Licence");
# You may not use this work except in compliance with the
# Licence.
# You may obtain a copy of the Licence at:
#
# http://ec.europa.eu/idabc/eupl
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the Licence is
# distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied.
# See the Licence for the specific language governing
# permissions and limitations under the Licence.
#
#############################################################
include Makefile.inc
@@ -0,0 +1,63 @@
#############################################################
#
# Copyright 2015 F4E | European Joint Undertaking for ITER
# and the Development of Fusion Energy ('Fusion for Energy')
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (the "Licence");
# You may not use this work except in compliance with the
# Licence.
# You may obtain a copy of the Licence at:
#
# http://ec.europa.eu/idabc/eupl
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the Licence is
# distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied.
# See the Licence for the specific language governing
# permissions and limitations under the Licence.
#
#############################################################
OBJSX = TCPStreamer.x
PACKAGE=Components/DataSources
ROOT_DIR=../../../../
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
INCLUDES += -I.
INCLUDES += -I$(ROOT_DIR)/Common/UDP
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/UDPStream
INCLUDES += -I$(ROOT_DIR)/Source/Components/DataSources/UDPStreamer
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/TCPStreamService
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L5GAMs
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
LIBRARIES += -L$(BUILD_DIR)/../../Interfaces/UDPStream -lUDPStream
LIBRARIES += -L$(ROOT_DIR)/Build/$(TARGET)/Components/Interfaces/TCPStreamService -lTCPStreamService
LIBRARIES += -L$(ROOT_DIR)/Build/$(TARGET)/Components/DataSources/UDPStreamer -lUDPStreamer
all: $(OBJS) \
$(BUILD_DIR)/TCPStreamer$(LIBEXT) \
$(BUILD_DIR)/TCPStreamer$(DLLEXT)
echo $(OBJS)
include depends.$(TARGET)
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
@@ -0,0 +1,172 @@
/**
* @file TCPStreamer.cpp
* @brief Source file for class TCPStreamer
* @date 05/11/2026
* @author Martino Ferrari
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*
* @details This source file contains the definition of all the methods for
* the class TCPStreamer (public, protected, and private).
*/
#define DLL_API
#include <string.h>
#include "AdvancedErrorManagement.h"
#include "ConfigurationDatabase.h"
#include "TCPStreamer.h"
namespace MARTe {
/* Owned by the TCPStreamService when Service is set. */
static const char8 *const tcpStreamerServiceKeys[] = {
"Port", "MaxClients", "ClientQueueDepth", "ClientStallTimeout", "SendBufferSize"
};
static const char8 *const tcpStreamerRejectedKeys[] = {
"MulticastGroup", "Interface", "DataPort", "ClientTimeout"
};
TCPStreamer::TCPStreamer() : UDPStreamer(), serviceStream(NULL_PTR(TCPSServiceStream *)) {
tcpServer = new TCPSServer();
SetServer(tcpServer);
}
TCPStreamer::~TCPStreamer() {
/* tcpServer is owned (and deleted) by UDPStreamer. */
tcpServer = NULL_PTR(TCPSServer *);
serviceStream = NULL_PTR(TCPSServiceStream *);
}
bool TCPStreamer::Initialise(StructuredDataI &data) {
bool ok = true;
const uint32 numKeys = data.GetNumberOfChildren();
for (uint32 i = 0u; (i < numKeys) && ok; i++) {
const char8 *name = data.GetChildName(i);
if (name == NULL_PTR(const char8 *)) {
continue;
}
for (uint32 k = 0u; k < (sizeof(tcpStreamerRejectedKeys) / sizeof(tcpStreamerRejectedKeys[0])); k++) {
if (strcmp(name, tcpStreamerRejectedKeys[k]) == 0) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Parameter '%s' is UDP-only and not supported by TCPStreamer.", name);
ok = false;
}
}
}
StreamString serviceName;
if (ok && data.Read("Service", serviceName) && (serviceName.Size() > 0u)) {
for (uint32 i = 0u; (i < numKeys) && ok; i++) {
const char8 *name = data.GetChildName(i);
for (uint32 k = 0u; (name != NULL_PTR(const char8 *)) &&
(k < (sizeof(tcpStreamerServiceKeys) / sizeof(tcpStreamerServiceKeys[0]))); k++) {
if (strcmp(name, tcpStreamerServiceKeys[k]) == 0) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Parameter '%s' belongs to the TCPStreamService and cannot be set together with Service.",
name);
ok = false;
}
}
}
StreamString streamName;
if (ok && (!data.Read("StreamName", streamName) || (streamName.Size() == 0u))) {
streamName = GetName();
}
if (ok && (streamName.Size() > TCPS_MAX_STREAM_NAME)) {
REPORT_ERROR(ErrorManagement::ParametersError,
"StreamName is longer than %u characters.", TCPS_MAX_STREAM_NAME);
ok = false;
}
if (ok) {
serviceStream = new TCPSServiceStream(serviceName.Buffer(), streamName.Buffer());
SetServer(serviceStream); /* replaces (and deletes) the private TCPSServer */
tcpServer = NULL_PTR(TCPSServer *);
}
}
if (ok) {
ok = UDPStreamer::Initialise(data);
}
return ok;
}
bool TCPStreamer::UsesService() const {
return serviceStream != NULL_PTR(TCPSServiceStream *);
}
uint16 TCPStreamer::GetBoundPort() const {
return UsesService() ? serviceStream->GetPort() : tcpServer->GetPort();
}
uint32 TCPStreamer::GetClientCount() const {
return UsesService() ? serviceStream->GetClientCount() : tcpServer->GetClientCount();
}
uint64 TCPStreamer::GetClientDrops() const {
return UsesService() ? serviceStream->GetClientDrops() : tcpServer->GetClientDrops();
}
uint32 TCPStreamer::GetStallEvictions() const {
return UsesService() ? 0u : tcpServer->GetStallEvictions();
}
uint32 TCPStreamer::DefaultMaxPayloadSize() const {
return TCPSServer::TCPS_DEFAULT_MAX_PAYLOAD;
}
bool TCPStreamer::InitialiseTransport(StructuredDataI &data) {
if (UsesService()) {
ConfigurationDatabase scdb;
bool sok = scdb.Write("MaxPayloadSize", GetMaxPayloadSize());
if (sok) {
sok = scdb.MoveToRoot();
}
if (sok) {
sok = serviceStream->Initialise(scdb);
}
if (!sok) {
REPORT_ERROR(ErrorManagement::ParametersError, "Could not configure the service stream.");
}
return sok;
}
ConfigurationDatabase cdb;
/* The base class has already resolved Port and MaxPayloadSize. */
bool ok = cdb.Write("Port", static_cast<uint32>(GetPort()));
if (ok) {
ok = cdb.Write("MaxPayloadSize", GetMaxPayloadSize());
}
const char8 *const optional[] = {
"MaxClients", "ClientQueueDepth", "ClientStallTimeout", "SendBufferSize"
};
for (uint32 k = 0u; (k < (sizeof(optional) / sizeof(optional[0]))) && ok; k++) {
uint32 v = 0u;
if (data.Read(optional[k], v)) {
ok = cdb.Write(optional[k], v);
}
}
if (ok) {
ok = cdb.MoveToRoot();
}
if (ok) {
ok = tcpServer->Initialise(cdb);
}
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "Could not configure the TCPSServer.");
}
return ok;
}
CLASS_REGISTER(TCPStreamer, "1.0")
} /* namespace MARTe */
@@ -0,0 +1,112 @@
/**
* @file TCPStreamer.h
* @brief Header file for class TCPStreamer
* @date 05/11/2026
* @author Martino Ferrari
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*
* @details This header file contains the declaration of the class TCPStreamer
* with all of its public, protected and private members.
*/
#ifndef TCPSTREAMER_H_
#define TCPSTREAMER_H_
#include "TCPSServer.h"
#include "TCPSServiceStream.h"
#include "UDPStreamer.h"
namespace MARTe {
/**
* @brief A DataSource that streams MARTe2 signals to TCP clients.
*
* @details Identical to UDPStreamer (same signals, quantisation, time modes and
* PublishingMode handling, same UDPS wire format) except that the network side
* is a TCPSServer: every client gets the CONFIG on connect and then every DATA
* frame, in order, over its own TCP connection. A client that cannot keep up
* only loses its own frames (counted by GetClientDrops()) and is disconnected
* after ClientStallTimeout seconds without progress; the RT thread and the
* other clients are unaffected.
*
* @par Configuration
* All UDPStreamer keys apply except the UDP-only ones (MulticastGroup,
* Interface, DataPort, ClientTimeout), which are rejected.
* | Parameter | Type | Default | Description |
* |--------------------|--------|---------|-------------|
* | Port | uint16 | 44500 | TCP listen port. |
* | MaxPayloadSize | uint32 | 60000 | Frame budget used to size Accumulate batches. |
* | MaxClients | uint32 | 16 | Simultaneous clients (1..1024). |
* | ClientQueueDepth | uint32 | 8 | DATA frames queued per client (1..4096). |
* | ClientStallTimeout | uint32 | 5 | Seconds without progress before a client is dropped; 0 disables. |
* | SendBufferSize | uint32 | 0 | SO_SNDBUF for client sockets; 0 keeps the OS default. |
*
* @par Shared service mode
* With `Service = <name of a TCPStreamService>` the DataSource does not open a
* socket of its own: it publishes a stream called `StreamName` (default: the
* DataSource name) through the shared in-process service, which serves many
* streams from one port with a pool of worker threads. Clients select the
* stream with the `StreamName` key of TCPStreamerClient / StreamHub. In this
* mode Port, MaxClients, ClientQueueDepth, ClientStallTimeout and
* SendBufferSize belong to the service and are rejected here.
* | Parameter | Type | Default | Description |
* |------------|--------|-----------------|-------------|
* | Service | string | *(absent)* | Object name of the TCPStreamService. |
* | StreamName | string | DataSource name | Stream name, unique per service (1..255 chars). |
*
* @par Example
* <pre>
* +Streamer = {
* Class = TCPStreamer
* Port = 44500
* Signals = {
* Time = { Type = uint64 }
* Value = { Type = float32 }
* }
* }
* </pre>
*/
class TCPStreamer : public UDPStreamer {
public:
CLASS_REGISTER_DECLARATION()
TCPStreamer();
virtual ~TCPStreamer();
/** Rejects the UDP-only keys, then behaves as UDPStreamer::Initialise(). */
virtual bool Initialise(StructuredDataI &data);
/** @return true when publishing through a TCPStreamService. */
bool UsesService() const;
/** @return the port actually bound (meaningful once started; resolves Port = 0). */
uint16 GetBoundPort() const;
/** @return clients currently connected. */
uint32 GetClientCount() const;
/** @return DATA frames dropped across all clients because their queue was full. */
uint64 GetClientDrops() const;
/** @return clients disconnected for exceeding ClientStallTimeout. */
uint32 GetStallEvictions() const;
protected:
virtual uint32 DefaultMaxPayloadSize() const;
virtual bool InitialiseTransport(StructuredDataI &data);
private:
TCPSServer *tcpServer; /**< Alias of the private transport (NULL in service mode). */
TCPSServiceStream *serviceStream; /**< Alias of the service handle (NULL in standalone mode). */
};
} /* namespace MARTe */
#endif /* TCPSTREAMER_H_ */
@@ -0,0 +1,145 @@
../../../..//Build/x86-linux/Components/DataSources/TCPStreamer/TCPStreamer.o: TCPStreamer.cpp \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
TCPStreamer.h \
../../../..//Source/Components/Interfaces/UDPStream/TCPSServer.h \
../../../..//Common/UDP/UDPSProtocol.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../..//Source/Components/Interfaces/TCPStreamService/TCPSServiceStream.h \
../../../..//Source/Components/Interfaces/TCPStreamService/TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../..//Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSServer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h
@@ -0,0 +1,145 @@
TCPStreamer.o: TCPStreamer.cpp \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
TCPStreamer.h \
../../../..//Source/Components/Interfaces/UDPStream/TCPSServer.h \
../../../..//Common/UDP/UDPSProtocol.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../..//Source/Components/Interfaces/TCPStreamService/TCPSServiceStream.h \
../../../..//Source/Components/Interfaces/TCPStreamService/TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../..//Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSServer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h
@@ -0,0 +1,25 @@
#############################################################
#
# Copyright 2015 F4E | European Joint Undertaking for ITER
# and the Development of Fusion Energy ('Fusion for Energy')
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (the "Licence");
# You may not use this work except in compliance with the
# Licence.
# You may obtain a copy of the Licence at:
#
# http://ec.europa.eu/idabc/eupl
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the Licence is
# distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied.
# See the Licence for the specific language governing
# permissions and limitations under the Licence.
#
#############################################################
include Makefile.inc
@@ -0,0 +1,62 @@
#############################################################
#
# Copyright 2015 F4E | European Joint Undertaking for ITER
# and the Development of Fusion Energy ('Fusion for Energy')
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (the "Licence");
# You may not use this work except in compliance with the
# Licence.
# You may obtain a copy of the Licence at:
#
# http://ec.europa.eu/idabc/eupl
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the Licence is
# distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied.
# See the Licence for the specific language governing
# permissions and limitations under the Licence.
#
#############################################################
OBJSX = TCPStreamerClient.x
PACKAGE=Components/DataSources
ROOT_DIR=../../../../
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
INCLUDES += -I.
INCLUDES += -I$(ROOT_DIR)/Common/UDP
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/UDPStream
INCLUDES += -I$(ROOT_DIR)/Source/Components/DataSources/UDPStreamerClient
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L5GAMs
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
LIBRARIES += -L$(MARTe2_DIR)/Build/$(TARGET)/Core -lMARTe2
LIBRARIES += -L$(ROOT_DIR)/Build/$(TARGET)/Components/Interfaces/UDPStream -lUDPStream
LIBRARIES += -L$(ROOT_DIR)/Build/$(TARGET)/Components/DataSources/UDPStreamerClient -lUDPStreamerClient
all: $(OBJS) \
$(BUILD_DIR)/TCPStreamerClient$(LIBEXT) \
$(BUILD_DIR)/TCPStreamerClient$(DLLEXT)
echo $(OBJS)
include depends.$(TARGET)
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
@@ -0,0 +1,122 @@
/**
* @file TCPStreamerClient.cpp
* @brief Source file for class TCPStreamerClient
* @date 05/11/2026
* @author Martino Ferrari
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*
* @details This source file contains the definition of all the methods for
* the class TCPStreamerClient (public, protected, and private).
*/
#define DLL_API
#include <string.h>
#include "AdvancedErrorManagement.h"
#include "ConfigurationDatabase.h"
#include "TCPStreamerClient.h"
namespace MARTe {
static const char8 *const tcpClientRejectedKeys[] = {
"MulticastGroup", "DataPort", "Interface", "KeepAliveInterval"
};
TCPStreamerClient::TCPStreamerClient() : UDPStreamerClient() {
tcpClient = new TCPSClient();
SetClient(tcpClient);
}
TCPStreamerClient::~TCPStreamerClient() {
/* tcpClient is owned (and deleted) by UDPStreamerClient. */
tcpClient = NULL_PTR(TCPSClient *);
}
bool TCPStreamerClient::Initialise(StructuredDataI &data) {
bool ok = true;
const uint32 numKeys = data.GetNumberOfChildren();
for (uint32 i = 0u; (i < numKeys) && ok; i++) {
const char8 *name = data.GetChildName(i);
if (name == NULL_PTR(const char8 *)) {
continue;
}
for (uint32 k = 0u; k < (sizeof(tcpClientRejectedKeys) / sizeof(tcpClientRejectedKeys[0])); k++) {
if (strcmp(name, tcpClientRejectedKeys[k]) == 0) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Parameter '%s' is UDP-only and not supported by TCPStreamerClient.", name);
ok = false;
}
}
}
if (ok) {
ok = UDPStreamerClient::Initialise(data);
}
return ok;
}
bool TCPStreamerClient::IsConnected() const {
return tcpClient->IsConnected();
}
uint32 TCPStreamerClient::GetConnectionCount() const {
return tcpClient->GetConnectionCount();
}
uint32 TCPStreamerClient::GetProtocolErrors() const {
return tcpClient->GetProtocolErrors();
}
bool TCPStreamerClient::InitialiseTransport(StructuredDataI &data) {
/* The TCP defaults differ from the UDP ones (no silence timeout, 2 s
* reconnect delay), so read them here rather than from the base members. */
float32 silenceTimeout = 0.0F;
if (!data.Read("SilenceTimeout", silenceTimeout)) {
silenceTimeout = 0.0F;
}
float32 reconnectDelay = static_cast<float32>(TCPSClient::TCPS_CLIENT_DEFAULT_RECONNECT_DELAY_S);
if (!data.Read("ReconnectDelay", reconnectDelay)) {
reconnectDelay = static_cast<float32>(TCPSClient::TCPS_CLIENT_DEFAULT_RECONNECT_DELAY_S);
}
ConfigurationDatabase cdb;
bool ok = cdb.Write("ServerAddr", serverAddress);
if (ok) { ok = cdb.Write("Port", static_cast<uint32>(port)); }
if (ok) { ok = cdb.Write("SilenceTimeout", silenceTimeout); }
if (ok) { ok = cdb.Write("ReconnectDelay", reconnectDelay); }
if (ok) { ok = cdb.Write("CPUMask", cpuMask); }
if (ok) { ok = cdb.Write("StackSize", stackSize); }
StreamString streamName;
if (ok && data.Read("StreamName", streamName)) {
if (strchr(streamName.Buffer(), ',') != NULL_PTR(char8 *)) {
REPORT_ERROR(ErrorManagement::ParametersError,
"StreamName must be a single stream: a TCPStreamerClient cannot multiplex.");
ok = false;
}
if (ok) {
ok = cdb.Write("StreamName", streamName.Buffer());
}
}
if (ok) { ok = cdb.MoveToRoot(); }
if (ok) { ok = tcpClient->Initialise(cdb); }
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "Could not configure the TCPSClient receiver.");
}
tcpClient->SetListener(this);
return ok;
}
CLASS_REGISTER(TCPStreamerClient, "1.0")
} /* namespace MARTe */
@@ -0,0 +1,79 @@
/**
* @file TCPStreamerClient.h
* @brief Header file for class TCPStreamerClient
* @date 05/11/2026
* @author Martino Ferrari
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*
* @details This header file contains the declaration of the class
* TCPStreamerClient with all of its public, protected and private members.
*/
#ifndef TCPSTREAMERCLIENT_H_
#define TCPSTREAMERCLIENT_H_
#include "TCPSClient.h"
#include "UDPStreamerClient.h"
namespace MARTe {
/**
* @brief A DataSource that receives a TCPStreamer (or any TCP UDPS server)
* stream and exposes it as input signals.
*
* @details Same signal handling and CONFIG validation as UDPStreamerClient; the
* transport is a TCPSClient that connects, reads framed UDPS packets, and
* reconnects automatically when the connection is lost.
*
* @par Configuration
* | Parameter | Type | Default | Description |
* |----------------|---------|-----------|-------------|
* | ServerAddress | string | 127.0.0.1 | Server IPv4 address or host name. |
* | Port | uint16 | 44500 | Server TCP port. |
* | SilenceTimeout | float32 | 0 | Seconds without any received byte before reconnecting; 0 disables. |
* | ReconnectDelay | float32 | 2 | Seconds between connection attempts. |
* | StreamName | string | *(absent)* | Stream to subscribe to on a TCPStreamService (omit for a plain TCPStreamer). |
* | CPUMask | uint32 | 0xFFFFFFFF| Receiver thread affinity. |
* | StackSize | uint32 | (default) | Receiver thread stack size. |
*
* MulticastGroup, DataPort, Interface and KeepAliveInterval are UDP-only and
* rejected.
*/
class TCPStreamerClient : public UDPStreamerClient {
public:
CLASS_REGISTER_DECLARATION()
TCPStreamerClient();
virtual ~TCPStreamerClient();
/** Rejects the UDP-only keys, then behaves as UDPStreamerClient::Initialise(). */
virtual bool Initialise(StructuredDataI &data);
/** @return true while connected to the server. */
bool IsConnected() const;
/** @return connections established so far. */
uint32 GetConnectionCount() const;
/** @return connections dropped because of a protocol violation. */
uint32 GetProtocolErrors() const;
protected:
virtual bool InitialiseTransport(StructuredDataI &data);
private:
TCPSClient *tcpClient; /**< Alias of the transport owned by UDPStreamerClient. */
};
} /* namespace MARTe */
#endif /* TCPSTREAMERCLIENT_H_ */
@@ -0,0 +1,144 @@
../../../..//Build/x86-linux/Components/DataSources/TCPStreamerClient/TCPStreamerClient.o: TCPStreamerClient.cpp \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
TCPStreamerClient.h \
../../../..//Source/Components/Interfaces/UDPStream/TCPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../../..//Common/UDP/UDPSProtocol.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../..//Source/Components/DataSources/UDPStreamerClient/UDPStreamerClient.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSClient.h
@@ -0,0 +1,144 @@
TCPStreamerClient.o: TCPStreamerClient.cpp \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
TCPStreamerClient.h \
../../../..//Source/Components/Interfaces/UDPStream/TCPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../../..//Common/UDP/UDPSProtocol.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../..//Source/Components/DataSources/UDPStreamerClient/UDPStreamerClient.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSClient.h
@@ -84,6 +84,7 @@ UDPStreamer::UDPStreamer()
: MemoryDataSourceI(), EmbeddedServiceMethodBinderI(), executor(*this) {
port = UDPS_DEFAULT_PORT;
maxPayloadSize = UDPS_DEFAULT_MAX_PAYLOAD;
server = new UDPSServer();
cpuMask = 0xFFFFFFFFu;
stackSize = THREADS_DEFAULT_STACKSIZE;
publishMode = UDPStreamerPublishStrict;
@@ -135,7 +136,11 @@ UDPStreamer::~UDPStreamer() {
}
}
(void)server.Stop();
if (server != NULL_PTR(UDPSServerI *)) {
(void)server->Stop();
delete server;
server = NULL_PTR(UDPSServerI *);
}
HeapI *heapAccum = GlobalObjectsDatabase::Instance()->GetStandardHeap();
if (accumBuffer != NULL_PTR(uint8 *)) {
@@ -192,7 +197,7 @@ bool UDPStreamer::Initialise(StructuredDataI &data) {
if (ok) {
if (!data.Read("MaxPayloadSize", maxPayloadSize)) {
maxPayloadSize = UDPS_DEFAULT_MAX_PAYLOAD;
maxPayloadSize = DefaultMaxPayloadSize();
REPORT_ERROR(ErrorManagement::Information,
"MaxPayloadSize not specified; using default %u.",
maxPayloadSize);
@@ -286,6 +291,18 @@ bool UDPStreamer::Initialise(StructuredDataI &data) {
}
if (ok) {
ok = InitialiseTransport(data);
}
return ok;
}
uint32 UDPStreamer::DefaultMaxPayloadSize() const {
return UDPS_DEFAULT_MAX_PAYLOAD;
}
bool UDPStreamer::InitialiseTransport(StructuredDataI &data) {
bool ok = true;
// Build server config with already-resolved Port and MaxPayloadSize so
// UDPSServer::Initialise() always sees them, even when defaults were used.
ConfigurationDatabase serverCfg;
@@ -312,12 +329,20 @@ bool UDPStreamer::Initialise(StructuredDataI &data) {
if (data.Read("ClientTimeout", clientTimeout)) {
(void)serverCfg.Write("ClientTimeout", clientTimeout);
}
ok = server.Initialise(serverCfg);
}
ok = server->Initialise(serverCfg);
return ok;
}
void UDPStreamer::SetServer(UDPSServerI *newServer) {
if (server != NULL_PTR(UDPSServerI *)) {
delete server;
}
server = newServer;
}
UDPSServerI *UDPStreamer::Transport() const { return server; }
bool UDPStreamer::SetConfiguredDatabase(StructuredDataI &data) {
bool ok = MemoryDataSourceI::SetConfiguredDatabase(data);
if (!ok) {
@@ -804,7 +829,7 @@ bool UDPStreamer::PrepareNextState(const char8 *const currentStateName,
const char8 *const nextStateName) {
bool ok = true;
ok = server.Start();
ok = server->Start();
/* Build the CONFIG payload and cache it in the server so any CONNECT client
* receives it immediately. The config is static for the lifetime of this
@@ -818,7 +843,7 @@ bool UDPStreamer::PrepareNextState(const char8 *const currentStateName,
if (cfgBuf != NULL_PTR(uint8 *)) {
uint32 cfgPayloadSize = 0u;
if (BuildConfigPayload(cfgBuf, configBufSize, cfgPayloadSize)) {
(void)server.SendConfig(cfgBuf, cfgPayloadSize);
(void)server->SendConfig(cfgBuf, cfgPayloadSize);
} else {
REPORT_ERROR(ErrorManagement::Warning,
"Could not build initial CONFIG payload.");
@@ -992,7 +1017,7 @@ ErrorManagement::ErrorType UDPStreamer::Execute(ExecutionInfo &info) {
/* --- Poll for incoming control commands (CONNECT / DISCONNECT / ACK) ---
*/
server.ServiceClients();
server->ServiceClients();
/* Synchronise() already gates publication to the correct rate (size/time
* for Accumulate, every-Nth for Decimate, every call for Strict). The
@@ -1015,12 +1040,12 @@ ErrorManagement::ErrorType UDPStreamer::Execute(ExecutionInfo &info) {
}
bufMutex.FastUnLock();
if ((fill > 0u) && server.HasClients()) {
if ((fill > 0u) && server->HasClients()) {
SerializeAccumulated(scratchBuffer, scratchTimestamps, fill);
uint32 sendBytes =
UDPS_TIMESTAMP_BYTES + 4u + fill * singleCycleWireBytes;
packetCounter++;
if (!server.SendData(packetCounter, wireBuffer, sendBytes)) {
if (!server->SendData(packetCounter, wireBuffer, sendBytes)) {
REPORT_ERROR(ErrorManagement::Warning,
"Failed to send Accumulate DATA packet (counter=%u).",
packetCounter);
@@ -1040,11 +1065,11 @@ ErrorManagement::ErrorType UDPStreamer::Execute(ExecutionInfo &info) {
}
bufMutex.FastUnLock();
if (pending && server.HasClients()) {
if (pending && server->HasClients()) {
QuantizeAndSerialize(scratchBuffer, ts);
packetCounter++;
if (!server.SendData(packetCounter, wireBuffer, totalWireBytes)) {
if (!server->SendData(packetCounter, wireBuffer, totalWireBytes)) {
REPORT_ERROR(ErrorManagement::Warning,
"Failed to send DATA packet (counter=%u).",
packetCounter);
@@ -1056,7 +1081,7 @@ ErrorManagement::ErrorType UDPStreamer::Execute(ExecutionInfo &info) {
}
if (info.GetStage() == ExecutionInfo::TerminationStage) {
(void)server.Stop();
(void)server->Stop();
REPORT_ERROR(ErrorManagement::Information,
"UDPStreamer background thread terminated.");
}
@@ -1367,9 +1392,9 @@ uint16 UDPStreamer::GetPort() const { return port; }
uint32 UDPStreamer::GetMaxPayloadSize() const { return maxPayloadSize; }
bool UDPStreamer::IsClientConnected() const { return server.HasClients(); }
bool UDPStreamer::IsClientConnected() const { return server->HasClients(); }
bool UDPStreamer::IsMulticast() const { return server.IsMulticast(); }
bool UDPStreamer::IsMulticast() const { return server->IsMulticast(); }
uint32 UDPStreamer::GetDroppedPublications() const { return droppedPublications; }
@@ -39,6 +39,7 @@
#include "SingleThreadService.h"
#include "StreamString.h"
#include "UDPSServer.h"
#include "UDPSTransportI.h"
/*---------------------------------------------------------------------------*/
/* Class declaration */
@@ -333,6 +334,33 @@ public:
*/
uint32 GetDroppedPublications() const;
protected:
/**
* @brief MaxPayloadSize used when the configuration does not specify one.
* @details Transport specific (a datagram budget for UDP, a frame budget for
* TCP), hence overridable. Called from Initialise(), not the constructor.
*/
virtual uint32 DefaultMaxPayloadSize() const;
/**
* @brief Configures the transport from the already-resolved Port and
* MaxPayloadSize plus whatever transport keys @p data carries.
* @details The default implementation configures the UDPSServer (unicast /
* multicast). A subclass that installs another transport with SetServer()
* overrides this to configure it instead.
*/
virtual bool InitialiseTransport(StructuredDataI &data);
/**
* @brief Replaces the transport. Takes ownership; only valid before Start().
*/
void SetServer(UDPSServerI *newServer);
/**
* @brief The transport currently in use (owned by this object).
*/
UDPSServerI *Transport() const;
private:
/**
* @brief Serializes the CONFIG payload into buf and sets payloadSize.
@@ -417,8 +445,8 @@ private:
uint8 *wireBuffer; /**< Pre-allocated buffer for the serialized DATA payload */
uint32 totalWireBytes; /**< Total bytes of all signals after quantization + 8-byte timestamp prefix */
/* Networking — handled by UDPSServer */
UDPSServer server; /**< Multi-client session manager (unicast and multicast) */
/* Networking — handled by a UDPSServerI (UDPSServer by default) */
UDPSServerI *server; /**< Owned transport; see SetServer() */
/* Thread management */
SingleThreadService executor; /**< Background thread service */
@@ -135,4 +135,6 @@
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../../..//Common/UDP/UDPSProtocol.h
../../../..//Common/UDP/UDPSProtocol.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h
@@ -135,4 +135,6 @@ UDPStreamer.o: UDPStreamer.cpp \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../../..//Common/UDP/UDPSProtocol.h
../../../..//Common/UDP/UDPSProtocol.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h
@@ -131,7 +131,8 @@ static float64 DequantValue(float64 raw, uint8 quantType,
UDPStreamerClient::UDPStreamerClient() :
MemoryDataSourceI(),
UDPSClientListener(),
client() {
client(NULL_PTR(UDPSClientI *)) {
client = new UDPSClient();
serverAddress = UDPS_CLIENT_DEFAULT_ADDR;
port = UDPS_CLIENT_DEFAULT_PORT;
maxPayloadSize = UDPS_CLIENT_DEFAULT_MAX_PAYLOAD;
@@ -160,10 +161,14 @@ UDPStreamerClient::UDPStreamerClient() :
UDPStreamerClient::~UDPStreamerClient() {
(void) dataSem.Post();
if (client != NULL_PTR(UDPSClientI *)) {
if (receiverUp) {
(void) client.Stop();
(void) client->Stop();
receiverUp = false;
}
delete client;
client = NULL_PTR(UDPSClientI *);
}
HeapI *heap = GlobalObjectsDatabase::Instance()->GetStandardHeap();
if (signalInfos != NULL_PTR(UDPStreamerClientSignal *)) {
@@ -258,9 +263,17 @@ bool UDPStreamerClient::Initialise(StructuredDataI &data) {
}
}
if (ok) {
ok = InitialiseTransport(data);
}
return ok;
}
bool UDPStreamerClient::InitialiseTransport(StructuredDataI &data) {
/* Forward the transport parameters to the shared UDPSClient receiver,
* translating the DataSource parameter names to the UDPSClient keys. */
if (ok) {
bool ok = true;
ConfigurationDatabase cdb;
ok = cdb.Write("ServerAddr", serverAddress);
if (ok) { ok = cdb.Write("Port", static_cast<uint32>(port)); }
@@ -277,17 +290,22 @@ bool UDPStreamerClient::Initialise(StructuredDataI &data) {
if (ok) { ok = cdb.Write("CPUMask", cpuMask); }
if (ok) { ok = cdb.Write("StackSize", stackSize); }
if (ok) { ok = cdb.MoveToRoot(); }
if (ok) { ok = client.Initialise(cdb); }
if (ok) { ok = client->Initialise(cdb); }
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Could not configure the UDPSClient receiver.");
}
client.SetListener(this);
}
client->SetListener(this);
return ok;
}
void UDPStreamerClient::SetClient(UDPSClientI *newClient) {
if (client != NULL_PTR(UDPSClientI *)) {
delete client;
}
client = newClient;
}
bool UDPStreamerClient::SetConfiguredDatabase(StructuredDataI &data) {
bool ok = MemoryDataSourceI::SetConfiguredDatabase(data);
if (!ok) {
@@ -377,7 +395,7 @@ bool UDPStreamerClient::PrepareNextState(const char8 *const currentStateName,
const char8 *const nextStateName) {
bool ok = true;
if (!receiverUp) {
ok = client.Start();
ok = client->Start();
if (ok) {
receiverUp = true;
}
@@ -160,6 +160,27 @@ public:
*/
virtual void OnUDPSDisconnected();
protected:
/**
* @brief Configures the transport from the already-parsed members and
* registers this object as its listener.
* @details The default implementation configures the UDPSClient (unicast /
* multicast). A subclass that installs another transport with SetClient()
* overrides this to configure it instead.
*/
virtual bool InitialiseTransport(StructuredDataI &data);
/**
* @brief Replaces the transport. Takes ownership; only valid before Start().
*/
void SetClient(UDPSClientI *newClient);
/* Configuration parameters shared with transport subclasses */
StreamString serverAddress; /**< Server IP address. */
uint16 port; /**< Server port. */
uint32 cpuMask; /**< Background thread CPU affinity. */
uint32 stackSize; /**< Background thread stack size. */
private:
/**
* @brief Decodes a single snapshot from a DATA payload into @p dst.
@@ -171,13 +192,9 @@ private:
void DecodeSnapshot(const uint8 *payload, uint32 size, uint8 *dst);
/* Configuration parameters */
StreamString serverAddress; /**< Server IP address. */
uint16 port; /**< Server port. */
uint32 maxPayloadSize; /**< Max payload bytes per datagram. */
uint32 keepAliveInterval; /**< Seconds between unicast keepalive ACKs (0 disables). */
float32 silenceTimeout; /**< Seconds of no data before reconnect (sub-second allowed, 0 disables). */
uint32 cpuMask; /**< Background thread CPU affinity. */
uint32 stackSize; /**< Background thread stack size. */
StreamString multicastGroup; /**< Multicast group IP; empty = unicast. */
StreamString multicastInterface; /**< Local IPv4 address for multicast join; empty = INADDR_ANY. */
uint16 dataPort; /**< UDP port for DATA datagrams (multicast). */
@@ -191,7 +208,7 @@ private:
uint8 publishMode; /**< UDPS_PUBLISH_* from CONFIG. */
/* Shared receiver (same code base as the StreamHub hub) */
UDPSClient client; /**< Transport, reassembly and reconnect. */
UDPSClientI *client; /**< Owned transport (UDPSClient by default); see SetClient(). */
bool receiverUp; /**< True once the receiver thread is started. */
/* Double-buffering for RT safety */
@@ -136,4 +136,5 @@
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h
@@ -136,4 +136,5 @@ UDPStreamerClient.o: UDPStreamerClient.cpp \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h
@@ -0,0 +1 @@
include Makefile.inc
@@ -0,0 +1,33 @@
#############################################################
# MARTe2 Integrated Components — TCPStreamService
#############################################################
OBJSX=TCPSFrameQueue.x TCPSServiceStream.x TCPSWorker.x TCPStreamService.x TCPStreamJoin.x
PACKAGE=Components/Interfaces
ROOT_DIR=../../../../
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
INCLUDES += -I.
INCLUDES += -I$(ROOT_DIR)/Common/UDP
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/UDPStream
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
all: $(OBJS) $(SUBPROJ) \
$(BUILD_DIR)/TCPStreamService$(LIBEXT) \
$(BUILD_DIR)/TCPStreamService$(DLLEXT)
echo $(OBJS)
include depends.$(TARGET)
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
@@ -0,0 +1,70 @@
#ifndef TCPS_CONN_H_
#define TCPS_CONN_H_
/**
* @file TCPSConn.h
* @brief One accepted connection of a TCPStreamService (internal).
*
* Ownership: created by the acceptor thread, then owned and deleted by exactly
* one TCPSWorker. `streams` and `closeRequested` are the only fields touched
* from other threads; `stream` is guarded by the service topology lock, the
* queue by `qMutex`.
*/
#include "CompilerTypes.h"
#include "FastPollingMutexSem.h"
#include "TCPSFrameQueue.h"
#include "TCPStreamService.h"
#include "UDPSProtocol.h"
#include <unistd.h>
namespace MARTe {
class TCPSWorker;
class TCPSServiceStream;
struct TCPSConn {
TCPSConn(int socketFd, TCPSWorker *owner, uint32 queueDepth, uint64 handshakeDeadline)
: fd(socketFd), worker(owner), subscribed(false), hsHave(0u),
hsWant(UDPS_HEADER_SIZE), hsHeaderOk(false), hsDeadline(handshakeDeadline),
numStreams(0u), closeRequested(false) {
for (uint32 i = 0u; i < TCPS_MAX_CONN_STREAMS; i++) {
streams[i] = NULL_PTR(TCPSServiceStream *);
}
q.Init(queueDepth);
}
~TCPSConn() {
if (fd >= 0) {
(void)close(fd);
}
}
int fd;
TCPSWorker *worker;
/* Worker-thread only. */
bool subscribed;
uint8 hs[UDPS_HEADER_SIZE + TCPS_MAX_SUBSCRIBE_PAYLOAD + 1u];
uint32 hsHave;
uint32 hsWant;
bool hsHeaderOk;
uint64 hsDeadline;
/* Service topology lock. */
TCPSServiceStream *streams[TCPS_MAX_CONN_STREAMS]; ///< index = stream index on the wire
uint32 numStreams;
volatile bool closeRequested;
/* qMutex. */
FastPollingMutexSem qMutex;
TCPSFrameQueue q;
private:
TCPSConn(const TCPSConn &);
TCPSConn &operator=(const TCPSConn &);
};
} // namespace MARTe
#endif // TCPS_CONN_H_
@@ -0,0 +1,204 @@
/**
* @file TCPSFrameQueue.cpp
* @brief Implementation of TCPSFrameQueue.
*/
#include "TCPSFrameQueue.h"
#include "HighResolutionTimer.h"
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/types.h>
namespace MARTe {
struct TCPSFrameQueue::Slot {
Slot() : buf(NULL_PTR(uint8 *)), cap(0u), len(0u), isConfig(false), stream(0u) {}
~Slot() {
if (buf != NULL_PTR(uint8 *)) {
delete[] buf;
}
}
uint8 *buf;
uint32 cap;
uint32 len;
bool isConfig;
uint16 stream;
};
/** magic(4) + type(1) + counter(4): offset of the header's fragmentIdx field. */
static const uint32 TCPS_FRAGIDX_OFFSET = 9u;
TCPSFrameQueue::TCPSFrameQueue()
: slots(NULL_PTR(Slot **)), cap(0u), depth(0u), count(0u), sent(0u), lastProgress(0u) {
}
TCPSFrameQueue::~TCPSFrameQueue() {
if (slots != NULL_PTR(Slot **)) {
for (uint32 i = 0u; i < cap; i++) {
delete slots[i];
}
delete[] slots;
}
}
void TCPSFrameQueue::Init(uint32 d) {
depth = d;
cap = d + 2u;
slots = new Slot *[cap];
for (uint32 i = 0u; i < cap; i++) {
slots[i] = new Slot();
}
count = 0u;
sent = 0u;
lastProgress = HighResolutionTimer::Counter();
}
void TCPSFrameQueue::Reserve(uint32 numStreams) {
const uint32 want = numStreams * (depth + 2u);
if (want > cap) {
Slot **grown = new Slot *[want];
for (uint32 i = 0u; i < cap; i++) {
grown[i] = slots[i];
}
for (uint32 i = cap; i < want; i++) {
grown[i] = new Slot();
}
delete[] slots;
slots = grown;
cap = want;
}
}
/** Remove slot @p i, keeping order; the slot object is recycled at the end. */
void TCPSFrameQueue::RemoveAt(uint32 i) {
Slot *v = slots[i];
for (uint32 j = i + 1u; j < count; j++) {
slots[j - 1u] = slots[j];
}
slots[count - 1u] = v;
count--;
}
bool TCPSFrameQueue::Push(uint16 streamIdx, bool isConfig, const uint8 *frame,
uint32 frameBytes, uint32 &dropped) {
const uint32 firstFree = (sent > 0u) ? 1u : 0u; // slots below this are on the wire
if (isConfig) {
uint32 i = firstFree;
while (i < count) {
if (slots[i]->stream == streamIdx) {
if (!slots[i]->isConfig) {
dropped++;
}
RemoveAt(i);
} else {
i++;
}
}
} else {
uint32 dataCount = 0u;
for (uint32 i = 0u; i < count; i++) {
if ((slots[i]->stream == streamIdx) && !slots[i]->isConfig) {
dataCount++;
}
}
if (dataCount >= depth) {
uint32 victim = count;
for (uint32 i = firstFree; (i < count) && (victim == count); i++) {
if ((slots[i]->stream == streamIdx) && !slots[i]->isConfig) {
victim = i;
}
}
dropped++;
if (victim == count) {
return false; // only the frame on the wire is queued
}
RemoveAt(victim);
}
}
if (count >= cap) {
dropped++;
return false;
}
Slot &s = *slots[count];
if (s.cap < frameBytes) {
if (s.buf != NULL_PTR(uint8 *)) {
delete[] s.buf;
}
s.buf = new uint8[frameBytes];
s.cap = frameBytes;
}
memcpy(s.buf, frame, frameBytes);
if (frameBytes >= (TCPS_FRAGIDX_OFFSET + 2u)) {
memcpy(&s.buf[TCPS_FRAGIDX_OFFSET], &streamIdx, 2u);
}
s.len = frameBytes;
s.isConfig = isConfig;
s.stream = streamIdx;
if (count == 0u) {
sent = 0u;
lastProgress = HighResolutionTimer::Counter();
}
count++;
return true;
}
/** Account for @p bytes written from the head of the queue. */
void TCPSFrameQueue::Consume(uint32 bytes) {
while ((bytes > 0u) && (count > 0u)) {
const uint32 left = slots[0]->len - sent;
if (bytes >= left) {
bytes -= left;
RemoveAt(0u);
sent = 0u;
} else {
sent += bytes;
bytes = 0u;
}
}
}
bool TCPSFrameQueue::Flush(int fd) {
bool alive = true;
while (alive && (count > 0u)) {
struct iovec iov[TCPS_MAX_BATCH];
uint32 n = (count < TCPS_MAX_BATCH) ? count : TCPS_MAX_BATCH;
for (uint32 i = 0u; i < n; i++) {
const uint32 off = (i == 0u) ? sent : 0u;
iov[i].iov_base = &slots[i]->buf[off];
iov[i].iov_len = slots[i]->len - off;
}
struct msghdr msg;
memset(&msg, 0, sizeof(msg));
msg.msg_iov = iov;
msg.msg_iovlen = n;
ssize_t w = sendmsg(fd, &msg, MSG_NOSIGNAL | MSG_DONTWAIT);
if (w > 0) {
lastProgress = HighResolutionTimer::Counter();
Consume(static_cast<uint32>(w));
} else if ((w < 0) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) {
break;
} else if ((w < 0) && (errno == EINTR)) {
continue;
} else {
alive = false;
}
}
return alive;
}
bool TCPSFrameQueue::Empty() const {
return count == 0u;
}
uint64 TCPSFrameQueue::LastProgress() const {
return lastProgress;
}
} // namespace MARTe
@@ -0,0 +1,79 @@
#ifndef TCPS_FRAME_QUEUE_H_
#define TCPS_FRAME_QUEUE_H_
/**
* @file TCPSFrameQueue.h
* @brief Bounded per-connection output queue of UDPS frames (header + payload).
*
* Same semantics as the per-client queue inside TCPSServer: at most `depth`
* DATA frames wait; when full the oldest DATA frame that is not already
* (partially) on the wire is discarded and counted. A CONFIG is never dropped
* and, when queued, discards the DATA frames behind the one on the wire (they
* were encoded for the previous layout).
*
* Not thread-safe: the owner serialises Push() / Flush().
*/
#include "CompilerTypes.h"
namespace MARTe {
class TCPSFrameQueue {
public:
TCPSFrameQueue();
~TCPSFrameQueue();
/** Allocate `depth` DATA slots plus two CONFIG slots (room for one stream). */
void Init(uint32 depth);
/**
* Make room for @p numStreams multiplexed streams: each gets its own `depth`
* DATA frames plus two CONFIG slots. Grow-only; call while the queue is idle
* (before the connection is attached to any stream).
*/
void Reserve(uint32 numStreams);
/**
* Append a complete frame (copied). The frame is stamped with @p streamIdx in
* its header's fragmentIdx field. Accounting is per stream: a full stream
* evicts its own oldest DATA, and a CONFIG only discards the queued frames
* of its own stream.
* @param[in,out] dropped incremented by the number of DATA frames discarded.
* @return false if the frame itself was refused (queue full of in-flight data).
*/
bool Push(uint16 streamIdx, bool isConfig, const uint8 *frame, uint32 frameBytes,
uint32 &dropped);
/**
* Write as much as the socket accepts without blocking, batching up to
* TCPS_MAX_BATCH frames per system call.
* @return false if the connection is broken.
*/
bool Flush(int fd);
/** Most frames sent by one sendmsg(). */
static const uint32 TCPS_MAX_BATCH = 16u;
bool Empty() const;
/** HRT ticks of the last byte written (or of the queue becoming non-empty). */
uint64 LastProgress() const;
private:
struct Slot;
TCPSFrameQueue(const TCPSFrameQueue &);
TCPSFrameQueue &operator=(const TCPSFrameQueue &);
void RemoveAt(uint32 i);
void Consume(uint32 bytes);
Slot **slots;
uint32 cap;
uint32 depth;
uint32 count;
uint32 sent;
uint64 lastProgress;
};
} // namespace MARTe
#endif // TCPS_FRAME_QUEUE_H_
@@ -0,0 +1,329 @@
/**
* @file TCPSServiceStream.cpp
* @brief Implementation of TCPSServiceStream.
*/
#define DLL_API
#include "TCPSServiceStream.h"
#include "AdvancedErrorManagement.h"
#include "ObjectRegistryDatabase.h"
#include "TCPSConn.h"
#include "TCPSWorker.h"
#include <string.h>
namespace MARTe {
const uint32 TCPSServiceStream::TCPSS_DEFAULT_MAX_PAYLOAD;
static const uint32 TCPSS_MAX_FRAME_PAYLOAD = 1048576u;
TCPSServiceStream::TCPSServiceStream(const char8 *serviceObjectName, const char8 *name)
: serviceName(serviceObjectName), streamName(name), registered(false),
maxPayloadSize(TCPSS_DEFAULT_MAX_PAYLOAD), subs(NULL_PTR(TCPSConn **)), subIdx(NULL_PTR(uint16 *)),
capSubs(0u), numSubs(0u), cachedConfigFrame(NULL_PTR(uint8 *)),
cachedConfigBytes(0u), cachedConfigCap(0u), configCounter(0u), drops(0u),
numTaps(0u), dataFrame(NULL_PTR(uint8 *)), dataFrameCap(0u) {
for (uint32 i = 0u; i < TCPSS_MAX_TAPS; i++) {
taps[i] = NULL_PTR(TCPSStreamTapI *);
}
}
TCPSServiceStream::~TCPSServiceStream() {
(void)Stop();
if (cachedConfigFrame != NULL_PTR(uint8 *)) {
delete[] cachedConfigFrame;
}
if (dataFrame != NULL_PTR(uint8 *)) {
delete[] dataFrame;
}
if (subs != NULL_PTR(TCPSConn **)) {
delete[] subs;
}
if (subIdx != NULL_PTR(uint16 *)) {
delete[] subIdx;
}
}
bool TCPSServiceStream::Initialise(StructuredDataI &data) {
bool ok = true;
maxPayloadSize = TCPSS_DEFAULT_MAX_PAYLOAD;
(void)data.Read("MaxPayloadSize", maxPayloadSize);
if ((maxPayloadSize == 0u) || (maxPayloadSize > TCPSS_MAX_FRAME_PAYLOAD)) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServiceStream: MaxPayloadSize %u must be in 1..%u.",
maxPayloadSize, TCPSS_MAX_FRAME_PAYLOAD);
ok = false;
}
if ((streamName.Size() > 0u) && (strchr(streamName.Buffer(), ',') != NULL_PTR(char8 *))) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServiceStream: StreamName '%s' may not contain a comma.",
streamName.Buffer());
ok = false;
}
if ((streamName.Size() == 0u) || (streamName.Size() > TCPS_MAX_STREAM_NAME)) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServiceStream: StreamName must be 1..%u characters.",
TCPS_MAX_STREAM_NAME);
ok = false;
}
return ok;
}
bool TCPSServiceStream::Start() {
if (registered) {
return true;
}
if (!service.IsValid()) {
ReferenceT<TCPStreamService> found =
ObjectRegistryDatabase::Instance()->Find(serviceName.Buffer());
if (!found.IsValid()) {
REPORT_ERROR_STATIC(ErrorManagement::InitialisationError,
"TCPSServiceStream: no TCPStreamService named '%s'.",
serviceName.Buffer());
return false;
}
service = found;
}
mutex.FastLock();
if (subs == NULL_PTR(TCPSConn **)) {
capSubs = service->MaxClients();
subs = new TCPSConn *[capSubs];
subIdx = new uint16[capSubs];
}
numSubs = 0u;
mutex.FastUnLock();
registered = service->RegisterStream(this);
return registered;
}
bool TCPSServiceStream::Stop() {
if (registered) {
service->UnregisterStream(this); // drops every subscriber
registered = false;
}
mutex.FastLock();
if (cachedConfigFrame != NULL_PTR(uint8 *)) {
cachedConfigBytes = 0u;
}
mutex.FastUnLock();
return true;
}
void TCPSServiceStream::ServiceClients() {
}
bool TCPSServiceStream::BuildFrame(uint8 *&buf, uint32 &cap, uint8 type, uint32 counter,
const uint8 *payload, uint32 payloadSize,
uint32 &frameBytes) {
bool ok = (payloadSize <= TCPSS_MAX_FRAME_PAYLOAD);
if (ok) {
const uint32 need = UDPS_HEADER_SIZE + payloadSize;
if (cap < need) {
if (buf != NULL_PTR(uint8 *)) {
delete[] buf;
}
buf = new uint8[need];
cap = need;
}
UDPSBuildHeader(buf, type, counter, 0u, 1u, payloadSize);
if (payloadSize > 0u) {
memcpy(&buf[UDPS_HEADER_SIZE], payload, payloadSize);
}
frameBytes = need;
}
return ok;
}
/** Caller holds `mutex`. */
void TCPSServiceStream::Distribute(bool isConfig, const uint8 *frame, uint32 frameBytes) {
for (uint32 i = 0u; i < numSubs; i++) {
TCPSConn *c = subs[i];
uint32 dropped = 0u;
c->qMutex.FastLock();
const bool wasEmpty = c->q.Empty();
(void)c->q.Push(subIdx[i], isConfig, frame, frameBytes, dropped);
c->qMutex.FastUnLock();
drops += dropped;
if (wasEmpty) {
c->worker->Wake();
}
}
}
bool TCPSServiceStream::SendConfig(const uint8 *payload, uint32 payloadSize) {
if (!registered) {
return false;
}
if (payloadSize > TCPSS_MAX_FRAME_PAYLOAD) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServiceStream: CONFIG of %u bytes exceeds the frame limit.",
payloadSize);
return false;
}
mutex.FastLock();
configCounter++;
bool ok = BuildFrame(cachedConfigFrame, cachedConfigCap, UDPS_TYPE_CONFIG, configCounter,
payload, payloadSize, cachedConfigBytes);
if (ok) {
Distribute(true, cachedConfigFrame, cachedConfigBytes);
}
mutex.FastUnLock();
if (ok && (numTaps > 0u)) {
tapMutex.FastLock();
for (uint32 i = 0u; i < numTaps; i++) {
taps[i]->OnTapConfig(this, payload, payloadSize);
}
tapMutex.FastUnLock();
}
return ok;
}
bool TCPSServiceStream::SendData(uint32 counter, const uint8 *payload, uint32 payloadSize) {
if (!registered) {
return false;
}
if (numTaps > 0u) {
tapMutex.FastLock();
for (uint32 i = 0u; i < numTaps; i++) {
taps[i]->OnTapData(this, counter, payload, payloadSize);
}
tapMutex.FastUnLock();
}
if (numSubs == 0u) {
return true;
}
uint32 frameBytes = 0u;
if (!BuildFrame(dataFrame, dataFrameCap, UDPS_TYPE_DATA, counter, payload, payloadSize,
frameBytes)) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServiceStream: DATA of %u bytes exceeds the frame limit.",
payloadSize);
return false;
}
mutex.FastLock();
Distribute(false, dataFrame, frameBytes);
mutex.FastUnLock();
return true;
}
bool TCPSServiceStream::AddTap(TCPSStreamTapI *tap) {
bool ok = false;
uint8 *cfg = NULL_PTR(uint8 *);
uint32 cfgBytes = 0u;
mutex.FastLock();
if (cachedConfigBytes > UDPS_HEADER_SIZE) {
cfgBytes = cachedConfigBytes - UDPS_HEADER_SIZE;
cfg = new uint8[cfgBytes];
memcpy(cfg, &cachedConfigFrame[UDPS_HEADER_SIZE], cfgBytes);
}
mutex.FastUnLock();
tapMutex.FastLock();
if (numTaps < TCPSS_MAX_TAPS) {
taps[numTaps] = tap;
numTaps = numTaps + 1u;
ok = true;
if (cfg != NULL_PTR(uint8 *)) {
tap->OnTapConfig(this, cfg, cfgBytes);
}
}
tapMutex.FastUnLock();
if (cfg != NULL_PTR(uint8 *)) {
delete[] cfg;
}
return ok;
}
void TCPSServiceStream::RemoveTap(TCPSStreamTapI *tap) {
tapMutex.FastLock();
for (uint32 i = 0u; i < numTaps; i++) {
if (taps[i] == tap) {
taps[i] = taps[numTaps - 1u];
numTaps = numTaps - 1u;
break;
}
}
tapMutex.FastUnLock();
}
bool TCPSServiceStream::HasClients() const {
/* A tap (TCPStreamJoin) consumes frames like a subscriber: the producer must keep publishing. */
return (numSubs > 0u) || (numTaps > 0u);
}
bool TCPSServiceStream::IsMulticast() const {
return false;
}
uint16 TCPSServiceStream::GetPort() const {
return service.IsValid() ? service->GetBoundPort() : static_cast<uint16>(0u);
}
const char8 *TCPSServiceStream::GetStreamName() const {
return streamName.Buffer();
}
uint32 TCPSServiceStream::GetClientCount() const {
return numSubs;
}
uint64 TCPSServiceStream::GetClientDrops() const {
return drops;
}
uint32 TCPSServiceStream::GetMaxPayloadSize() const {
return maxPayloadSize;
}
bool TCPSServiceStream::AttachConn(TCPSConn *c, uint16 streamIdx) {
bool ok = false;
mutex.FastLock();
if (numSubs < capSubs) {
// The CONFIG goes in first so the client always decodes DATA against it.
if (cachedConfigBytes > 0u) {
uint32 dropped = 0u;
c->qMutex.FastLock();
(void)c->q.Push(streamIdx, true, cachedConfigFrame, cachedConfigBytes, dropped);
c->qMutex.FastUnLock();
}
subs[numSubs] = c;
subIdx[numSubs] = streamIdx;
numSubs = numSubs + 1u;
ok = true;
}
mutex.FastUnLock();
return ok;
}
void TCPSServiceStream::DetachConn(TCPSConn *c) {
mutex.FastLock();
for (uint32 i = 0u; i < numSubs; i++) {
if (subs[i] == c) {
subs[i] = subs[numSubs - 1u];
subIdx[i] = subIdx[numSubs - 1u];
numSubs = numSubs - 1u;
break;
}
}
mutex.FastUnLock();
}
void TCPSServiceStream::DropAllConns() {
mutex.FastLock();
for (uint32 i = 0u; i < numSubs; i++) {
TCPSConn *c = subs[i];
for (uint32 k = 0u; k < c->numStreams; k++) {
if (c->streams[k] == this) {
c->streams[k] = NULL_PTR(TCPSServiceStream *);
}
}
subs[i]->closeRequested = true;
subs[i]->worker->Wake();
}
numSubs = 0u;
mutex.FastUnLock();
}
} // namespace MARTe
@@ -0,0 +1,110 @@
#ifndef TCPS_SERVICE_STREAM_H_
#define TCPS_SERVICE_STREAM_H_
/**
* @file TCPSServiceStream.h
* @brief UDPSServerI handle that publishes one named stream through a
* TCPStreamService instead of through a private listening socket.
*
* It is what a TCPStreamer uses when its `Service` key is set. All socket work
* (accept, handshake, flush, eviction) is done by the service's threads; the
* producer thread only builds the frame and copies it into the bounded queue of
* every subscribed connection (SendData never blocks on a socket).
*/
#include "FastPollingMutexSem.h"
#include "ReferenceT.h"
#include "StreamString.h"
#include "MutexSem.h"
#include "TCPSStreamTapI.h"
#include "TCPStreamService.h"
#include "UDPSProtocol.h"
#include "UDPSTransportI.h"
namespace MARTe {
struct TCPSConn;
class TCPSServiceStream : public UDPSServerI {
public:
/** Default maximum payload bytes per frame (matches TCPSServer). */
static const uint32 TCPSS_DEFAULT_MAX_PAYLOAD = 60000u;
TCPSServiceStream(const char8 *serviceObjectName, const char8 *streamName);
virtual ~TCPSServiceStream();
/** Keys: MaxPayloadSize (uint32, 1..1 MiB, default 60000). */
virtual bool Initialise(StructuredDataI &data);
/** Resolve the service by name and register the stream (fails on a duplicate name). */
virtual bool Start();
/** Unregister and drop every subscriber (idempotent). */
virtual bool Stop();
/** No-op: the service threads do the housekeeping. */
virtual void ServiceClients();
virtual bool SendConfig(const uint8 *payload, uint32 payloadSize);
virtual bool SendData(uint32 counter, const uint8 *payload, uint32 payloadSize);
virtual bool HasClients() const;
virtual bool IsMulticast() const;
/** @return the service's bound port (0 while the service is unresolved). */
virtual uint16 GetPort() const;
const char8 *GetStreamName() const;
uint32 GetClientCount() const;
/** @return DATA frames discarded for slow subscribers (all time). */
uint64 GetClientDrops() const;
uint32 GetMaxPayloadSize() const;
/** Most taps one stream can carry. */
static const uint32 TCPSS_MAX_TAPS = 4u;
/**
* Observe every CONFIG / DATA this stream publishes. The cached CONFIG (if any) is
* replayed to the new tap before AddTap returns. Taps run on the producer thread.
* @return false if the tap table is full.
*/
bool AddTap(TCPSStreamTapI *tap);
/** Remove a tap; once it returns no callback is running or will start. */
void RemoveTap(TCPSStreamTapI *tap);
/* ---- called by TCPStreamService with its topology lock held ---- */
/** Add a connection and prime it with the cached CONFIG. @return false if full. */
bool AttachConn(TCPSConn *c, uint16 streamIdx);
void DetachConn(TCPSConn *c);
/** Ask every subscriber to close and forget them. */
void DropAllConns();
private:
bool BuildFrame(uint8 *&buf, uint32 &cap, uint8 type, uint32 counter,
const uint8 *payload, uint32 payloadSize, uint32 &frameBytes);
void Distribute(bool isConfig, const uint8 *frame, uint32 frameBytes);
StreamString serviceName;
mutable StreamString streamName;
ReferenceT<TCPStreamService> service;
bool registered;
uint32 maxPayloadSize;
FastPollingMutexSem mutex; ///< guards subs, numSubs, cachedConfig*, drops
TCPSConn **subs;
uint16 *subIdx; ///< stream index each subscriber knows this stream by
uint32 capSubs;
volatile uint32 numSubs;
uint8 *cachedConfigFrame;
uint32 cachedConfigBytes;
uint32 cachedConfigCap;
uint32 configCounter;
uint64 drops;
FastPollingMutexSem tapMutex; ///< held while a tap callback runs
TCPSStreamTapI *taps[TCPSS_MAX_TAPS];
volatile uint32 numTaps;
uint8 *dataFrame; ///< producer-thread scratch
uint32 dataFrameCap;
TCPSServiceStream(const TCPSServiceStream &);
TCPSServiceStream &operator=(const TCPSServiceStream &);
};
} // namespace MARTe
#endif // TCPS_SERVICE_STREAM_H_
@@ -0,0 +1,40 @@
#ifndef TCPS_STREAM_TAP_I_H_
#define TCPS_STREAM_TAP_I_H_
/**
* @file TCPSStreamTapI.h
* @brief Hooks used by TCPStreamJoin to follow the streams of a TCPStreamService.
*
* TCPSStreamTapI observes the CONFIG / DATA payloads a stream publishes (on the
* producer's thread, after the frame went to the subscribers). TCPSStreamObserverI
* observes streams registering with / leaving a service.
*/
#include "CompilerTypes.h"
namespace MARTe {
class TCPSServiceStream;
class TCPSStreamTapI {
public:
virtual ~TCPSStreamTapI() {}
/** A CONFIG payload was published (or the cached one is replayed on AddTap). */
virtual void OnTapConfig(TCPSServiceStream *source, const uint8 *payload, uint32 payloadSize) = 0;
/** A DATA payload was published. */
virtual void OnTapData(TCPSServiceStream *source, uint32 counter, const uint8 *payload,
uint32 payloadSize) = 0;
};
class TCPSStreamObserverI {
public:
virtual ~TCPSStreamObserverI() {}
/** @p stream just registered. May call back into the service. */
virtual void OnStreamRegistered(TCPSServiceStream *stream) = 0;
/** @p stream is leaving (it is still valid during the call). */
virtual void OnStreamUnregistered(TCPSServiceStream *stream) = 0;
};
} // namespace MARTe
#endif // TCPS_STREAM_TAP_I_H_
@@ -0,0 +1,266 @@
/**
* @file TCPSWorker.cpp
* @brief Implementation of TCPSWorker.
*/
#define DLL_API
#include "TCPSWorker.h"
#include "AdvancedErrorManagement.h"
#include "Atomic.h"
#include "HighResolutionTimer.h"
#include "TCPSConn.h"
#include "TCPStreamService.h"
#include "UDPSProtocol.h"
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
namespace MARTe {
/** Longest wait in poll(): bounds Stop() latency and the stall / handshake checks. */
static const int TCPS_WORKER_SLICE_MS = 50;
TCPSWorker::TCPSWorker(TCPStreamService &owner, uint32 maxConnections)
: service(owner), maxConns(maxConnections), thread(*this),
incoming(new TCPSConn *[maxConnections]), numIncoming(0u),
conns(new TCPSConn *[maxConnections]), numConns(0u),
pfds(new struct pollfd[maxConnections + 1u]), load(0) {
wakeFd[0] = -1;
wakeFd[1] = -1;
if (pipe(wakeFd) == 0) {
for (int i = 0; i < 2; i++) {
int flags = fcntl(wakeFd[i], F_GETFL, 0);
if (flags >= 0) {
(void)fcntl(wakeFd[i], F_SETFL, flags | O_NONBLOCK);
}
}
}
}
TCPSWorker::~TCPSWorker() {
Stop();
CloseAll();
for (uint32 i = 0u; i < numIncoming; i++) {
delete incoming[i];
service.ConnClosed();
}
delete[] incoming;
delete[] conns;
delete[] pfds;
for (int i = 0; i < 2; i++) {
if (wakeFd[i] >= 0) {
(void)close(wakeFd[i]);
}
}
}
bool TCPSWorker::Start(uint32 cpuMask, uint32 stackSize) {
if (wakeFd[0] < 0) {
return false;
}
thread.SetCPUMask(cpuMask);
thread.SetStackSize(stackSize);
return thread.Start() == ErrorManagement::NoError;
}
void TCPSWorker::Stop() {
(void)thread.Stop();
}
bool TCPSWorker::AddIncoming(TCPSConn *c) {
bool ok = false;
incomingMutex.FastLock();
if (numIncoming < maxConns) {
incoming[numIncoming] = c;
numIncoming++;
ok = true;
}
incomingMutex.FastUnLock();
if (ok) {
Atomic::Increment(&load);
Wake();
}
return ok;
}
void TCPSWorker::Wake() {
if (wakeFd[1] >= 0) {
const uint8 b = 1u;
// EAGAIN means the pipe is already full of wake-ups: nothing to add.
ssize_t r = write(wakeFd[1], &b, 1u);
(void)r;
}
}
int32 TCPSWorker::Load() const {
return load;
}
void TCPSWorker::AdoptIncoming() {
incomingMutex.FastLock();
for (uint32 i = 0u; i < numIncoming; i++) {
conns[numConns] = incoming[i];
numConns++;
}
numIncoming = 0u;
incomingMutex.FastUnLock();
}
void TCPSWorker::CloseConn(TCPSConn *c) {
service.Detach(c);
delete c; // closes the socket
service.ConnClosed();
Atomic::Decrement(&load);
}
void TCPSWorker::CloseAll() {
for (uint32 i = 0u; i < numConns; i++) {
CloseConn(conns[i]);
}
numConns = 0u;
}
bool TCPSWorker::Drain(TCPSConn &c) {
uint8 scratch[64];
bool alive = true;
for (;;) {
ssize_t n = recv(c.fd, scratch, sizeof(scratch), MSG_DONTWAIT);
if (n > 0) {
continue; // clients have nothing more to say after SUBSCRIBE
}
if (n == 0) {
alive = false;
} else if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
alive = true;
} else if (errno == EINTR) {
continue;
} else {
alive = false;
}
break;
}
return alive;
}
bool TCPSWorker::HandshakeStep(TCPSConn &c) {
ssize_t n = recv(c.fd, &c.hs[c.hsHave], c.hsWant - c.hsHave, MSG_DONTWAIT);
if (n == 0) {
return false;
}
if (n < 0) {
return (errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINTR);
}
c.hsHave += static_cast<uint32>(n);
if (!c.hsHeaderOk && (c.hsHave >= UDPS_HEADER_SIZE)) {
UDPSPacketHeader h;
memcpy(&h, c.hs, UDPS_HEADER_SIZE);
if ((h.magic != UDPS_MAGIC) || (h.type != UDPS_TYPE_SUBSCRIBE) ||
(h.payloadBytes == 0u) || (h.payloadBytes > TCPS_MAX_SUBSCRIBE_PAYLOAD)) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPStreamService: connection did not open with a valid SUBSCRIBE; closing.");
service.NoteRejected();
return false;
}
c.hsHeaderOk = true;
c.hsWant = UDPS_HEADER_SIZE + h.payloadBytes;
}
if (c.hsHeaderOk && (c.hsHave == c.hsWant)) {
c.hs[c.hsWant] = 0u;
char8 *names = reinterpret_cast<char8 *>(&c.hs[UDPS_HEADER_SIZE]);
if (!service.Attach(&c, names)) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPStreamService: cannot attach to '%s'; closing.", names);
service.NoteRejected();
return false;
}
c.subscribed = true;
}
return true;
}
ErrorManagement::ErrorType TCPSWorker::Execute(ExecutionInfo &info) {
if (info.GetStage() == ExecutionInfo::TerminationStage) {
return ErrorManagement::NoError;
}
if (info.GetStage() != ExecutionInfo::MainStage) {
return ErrorManagement::NoError;
}
AdoptIncoming();
pfds[0].fd = wakeFd[0];
pfds[0].events = POLLIN;
pfds[0].revents = 0;
for (uint32 i = 0u; i < numConns; i++) {
TCPSConn *c = conns[i];
short ev = POLLIN;
if (c->subscribed) {
c->qMutex.FastLock();
if (!c->q.Empty()) {
ev = static_cast<short>(ev | POLLOUT);
}
c->qMutex.FastUnLock();
}
pfds[i + 1u].fd = c->fd;
pfds[i + 1u].events = ev;
pfds[i + 1u].revents = 0;
}
int pr = poll(pfds, static_cast<nfds_t>(numConns + 1u), TCPS_WORKER_SLICE_MS);
if (pr < 0) {
return ErrorManagement::NoError; // EINTR
}
if ((pfds[0].revents & POLLIN) != 0) {
uint8 sink[64];
while (read(wakeFd[0], sink, sizeof(sink)) > 0) {
}
}
const uint64 now = HighResolutionTimer::Counter();
const uint64 stallTicks = service.StallTicks();
uint32 kept = 0u;
for (uint32 i = 0u; i < numConns; i++) {
TCPSConn *c = conns[i];
const short re = pfds[i + 1u].revents;
bool keep = !c->closeRequested && ((re & (POLLERR | POLLNVAL)) == 0);
if (keep && ((re & (POLLIN | POLLHUP)) != 0)) {
keep = c->subscribed ? Drain(*c) : HandshakeStep(*c);
}
if (keep && c->subscribed) {
c->qMutex.FastLock();
keep = c->q.Flush(c->fd);
if (keep && !c->q.Empty() && (stallTicks > 0u) &&
(now > c->q.LastProgress()) && ((now - c->q.LastProgress()) > stallTicks)) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPStreamService: client stalled; disconnecting.");
service.NoteEviction();
keep = false;
}
c->qMutex.FastUnLock();
}
if (keep && !c->subscribed && (now > c->hsDeadline)) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPStreamService: SUBSCRIBE timeout; closing.");
service.NoteRejected();
keep = false;
}
if (keep) {
conns[kept] = c;
kept++;
} else {
CloseConn(c);
}
}
numConns = kept;
return ErrorManagement::NoError;
}
} // namespace MARTe
@@ -0,0 +1,68 @@
#ifndef TCPS_WORKER_H_
#define TCPS_WORKER_H_
/**
* @file TCPSWorker.h
* @brief One I/O thread of a TCPStreamService (internal).
*
* Owns a set of connections, polls them (plus a self-pipe used by producers to
* announce new frames), performs the SUBSCRIBE handshake, flushes the bounded
* queues and evicts stalled / dead peers.
*/
#include "EmbeddedServiceMethodBinderI.h"
#include "ExecutionInfo.h"
#include "FastPollingMutexSem.h"
#include "SingleThreadService.h"
#include <poll.h>
namespace MARTe {
class TCPStreamService;
struct TCPSConn;
class TCPSWorker : public EmbeddedServiceMethodBinderI {
public:
TCPSWorker(TCPStreamService &owner, uint32 maxConns);
virtual ~TCPSWorker();
bool Start(uint32 cpuMask, uint32 stackSize);
void Stop();
/** Hand a freshly accepted connection to this worker (acceptor thread). */
bool AddIncoming(TCPSConn *c);
/** Interrupt the poll so queued data is flushed now (any thread, cheap). */
void Wake();
/** @return connections currently assigned (approximate). */
int32 Load() const;
virtual ErrorManagement::ErrorType Execute(ExecutionInfo &info);
private:
void AdoptIncoming();
bool HandshakeStep(TCPSConn &c);
bool Drain(TCPSConn &c);
void CloseConn(TCPSConn *c);
void CloseAll();
TCPStreamService &service;
uint32 maxConns;
SingleThreadService thread;
int wakeFd[2];
FastPollingMutexSem incomingMutex;
TCPSConn **incoming;
uint32 numIncoming;
TCPSConn **conns;
uint32 numConns;
struct pollfd *pfds;
volatile int32 load;
};
} // namespace MARTe
#endif // TCPS_WORKER_H_
@@ -0,0 +1,494 @@
/**
* @file TCPStreamJoin.cpp
* @brief Source file for class TCPStreamJoin
* @date 06/11/2026
* @author Martino Ferrari
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*/
#define DLL_API
#include "TCPStreamJoin.h"
#include "AdvancedErrorManagement.h"
#include "ConfigurationDatabase.h"
#include "ObjectRegistryDatabase.h"
#include "UDPSProtocol.h"
#include <stdio.h>
#include <string.h>
namespace MARTe {
const uint32 TCPStreamJoin::TCPSJ_MAX_SOURCES;
TCPStreamJoin::Source::Source()
: stream(NULL_PTR(TCPSServiceStream *)), configOk(false), cfg(NULL_PTR(uint8 *)),
cfgBytes(0u), numSigs(0u), hrt(0u), body(NULL_PTR(uint8 *)), bodyCap(0u),
bodySize(0u), haveBody(false) {
}
TCPStreamJoin::Source::~Source() {
if (cfg != NULL_PTR(uint8 *)) {
delete[] cfg;
}
if (body != NULL_PTR(uint8 *)) {
delete[] body;
}
}
TCPStreamJoin::TCPStreamJoin()
: Object(), TCPSStreamTapI(), TCPSStreamObserverI(), out(NULL_PTR(TCPSServiceStream *)),
observing(false), src(NULL_PTR(Source *)), numSrc(0u), master(0u), maxPayload(60000u),
active(false), configPublished(false), sizeLogged(false), outCounter(0u), emitted(0u),
scratch(NULL_PTR(uint8 *)), scratchCap(0u) {
}
TCPStreamJoin::~TCPStreamJoin() {
if (observing) {
service->RemoveObserver(this);
observing = false;
}
for (uint32 i = 0u; i < numSrc; i++) {
mtx.FastLock();
TCPSServiceStream *s = src[i].stream;
src[i].stream = NULL_PTR(TCPSServiceStream *);
mtx.FastUnLock();
if (s != NULL_PTR(TCPSServiceStream *)) {
s->RemoveTap(this);
}
}
if (out != NULL_PTR(TCPSServiceStream *)) {
delete out; // unregisters the merged stream
out = NULL_PTR(TCPSServiceStream *);
}
if (src != NULL_PTR(Source *)) {
delete[] src;
}
if (scratch != NULL_PTR(uint8 *)) {
delete[] scratch;
}
}
bool TCPStreamJoin::Initialise(StructuredDataI &data) {
bool ok = Object::Initialise(data);
StreamString serviceName;
if (ok && (!data.Read("Service", serviceName) || (serviceName.Size() == 0u))) {
REPORT_ERROR(ErrorManagement::ParametersError, "Parameter 'Service' is required.");
ok = false;
}
if (ok && (!data.Read("StreamName", outName) || (outName.Size() == 0u))) {
outName = GetName();
}
StreamString sources;
if (ok && (!data.Read("Sources", sources) || (sources.Size() == 0u))) {
REPORT_ERROR(ErrorManagement::ParametersError, "Parameter 'Sources' is required.");
ok = false;
}
StreamString masterName;
if (ok && !data.Read("Master", masterName)) {
masterName = "";
}
maxPayload = 60000u;
(void)data.Read("MaxPayloadSize", maxPayload);
if (ok) {
// Split "a, b ,c" into trimmed names.
src = new Source[TCPSJ_MAX_SOURCES];
const char8 *p = sources.Buffer();
while (ok && (p != NULL_PTR(const char8 *))) {
const char8 *comma = strchr(p, ',');
const char8 *end = (comma != NULL_PTR(const char8 *)) ? comma : (p + strlen(p));
while ((p < end) && (*p == ' ')) {
p++;
}
const char8 *e = end;
while ((e > p) && (e[-1] == ' ')) {
e--;
}
const uint32 len = static_cast<uint32>(e - p);
if ((len == 0u) || (len > TCPS_MAX_STREAM_NAME) || (numSrc >= TCPSJ_MAX_SOURCES)) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Sources must list 1..%u names of 1..%u characters.",
TCPSJ_MAX_SOURCES, TCPS_MAX_STREAM_NAME);
ok = false;
}
if (ok) {
StreamString name;
uint32 wlen = len;
(void)name.Write(p, wlen);
for (uint32 i = 0u; i < numSrc; i++) {
if (src[i].name == name) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Source '%s' is listed twice.", name.Buffer());
ok = false;
}
}
if (name == outName) {
REPORT_ERROR(ErrorManagement::ParametersError,
"The merged stream '%s' cannot be one of its own sources.",
name.Buffer());
ok = false;
}
src[numSrc].name = name;
numSrc++;
}
p = (comma != NULL_PTR(const char8 *)) ? (comma + 1) : NULL_PTR(const char8 *);
}
}
if (ok && (masterName.Size() > 0u)) {
const int32 m = FindByName(masterName.Buffer());
if (m < 0) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Master '%s' is not one of the Sources.", masterName.Buffer());
ok = false;
}
else {
master = static_cast<uint32>(m);
}
}
if (ok) {
service = ObjectRegistryDatabase::Instance()->Find(serviceName.Buffer());
if (!service.IsValid()) {
REPORT_ERROR(ErrorManagement::InitialisationError,
"No TCPStreamService named '%s' (declare it before the join).",
serviceName.Buffer());
ok = false;
}
}
if (ok) {
out = new TCPSServiceStream(serviceName.Buffer(), outName.Buffer());
ConfigurationDatabase scdb;
ok = scdb.Write("MaxPayloadSize", maxPayload) && scdb.MoveToRoot() && out->Initialise(scdb);
}
if (ok) {
// Last: the replay of already registered streams may complete the join right here.
observing = service->AddObserver(this);
if (!observing) {
REPORT_ERROR(ErrorManagement::InitialisationError,
"The service cannot take another observer.");
ok = false;
}
}
return ok;
}
int32 TCPStreamJoin::FindByName(const char8 *name) const {
int32 r = -1;
for (uint32 i = 0u; (i < numSrc) && (r < 0); i++) {
if (strcmp(src[i].name.Buffer(), name) == 0) {
r = static_cast<int32>(i);
}
}
return r;
}
int32 TCPStreamJoin::FindByStream(const TCPSServiceStream *s) const {
int32 r = -1;
for (uint32 i = 0u; (i < numSrc) && (r < 0); i++) {
if (src[i].stream == s) {
r = static_cast<int32>(i);
}
}
return r;
}
bool TCPStreamJoin::AllRegistered() const {
bool all = true;
for (uint32 i = 0u; i < numSrc; i++) {
all = all && (src[i].stream != NULL_PTR(TCPSServiceStream *));
}
return all;
}
bool TCPStreamJoin::IsActive() const {
return active;
}
bool TCPStreamJoin::HasConfig() const {
return configPublished;
}
uint64 TCPStreamJoin::GetFramesEmitted() const {
return emitted;
}
uint32 TCPStreamJoin::GetNumSources() const {
return numSrc;
}
void TCPStreamJoin::OnStreamRegistered(TCPSServiceStream *stream) {
bool mine = false;
int32 idx = -1;
mtx.FastLock();
idx = FindByName(stream->GetStreamName());
if ((idx >= 0) && (src[idx].stream == NULL_PTR(TCPSServiceStream *))) {
src[idx].stream = stream;
mine = true;
}
mtx.FastUnLock();
if (!mine) {
return;
}
// Replays the cached CONFIG into OnTapConfig; the join mutex must not be held.
if (!stream->AddTap(this)) {
REPORT_ERROR(ErrorManagement::InitialisationError,
"Stream '%s' cannot take another tap.", stream->GetStreamName());
mtx.FastLock();
src[idx].stream = NULL_PTR(TCPSServiceStream *);
mtx.FastUnLock();
return;
}
Evaluate();
}
void TCPStreamJoin::Evaluate() {
mtx.FastLock();
const bool start = !active && AllRegistered();
mtx.FastUnLock();
if (start) {
// Registering may call back into observers (including this one): no lock held.
const bool ok = out->Start();
mtx.FastLock();
if (ok) {
active = true;
outCounter = 0u;
PublishConfigLocked();
}
mtx.FastUnLock();
}
}
void TCPStreamJoin::OnStreamUnregistered(TCPSServiceStream *stream) {
mtx.FastLock();
const int32 idx = FindByStream(stream);
bool wasActive = false;
if (idx >= 0) {
Source &s = src[idx];
s.stream = NULL_PTR(TCPSServiceStream *);
s.configOk = false;
s.haveBody = false;
s.bodySize = 0u;
wasActive = active;
active = false;
configPublished = false;
}
mtx.FastUnLock();
if (idx < 0) {
return;
}
stream->RemoveTap(this);
if (wasActive) {
(void)out->Stop(); // subscribers of the merged stream are dropped
}
}
bool TCPStreamJoin::ParseConfig(Source &s, const uint8 *payload, uint32 n) {
bool ok = (n >= 5u);
uint32 numSigs = 0u;
if (ok) {
memcpy(&numSigs, payload, 4u);
const uint64 need = 4u + static_cast<uint64>(numSigs) * UDPS_SIGNAL_DESC_SIZE + 1u;
ok = (numSigs > 0u) && (need <= n);
}
if (ok) {
const uint32 off = 4u + numSigs * UDPS_SIGNAL_DESC_SIZE;
if (payload[off] == UDPS_PUBLISH_ACCUMULATE) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Source '%s' uses Accumulate publishing, which cannot be merged.",
s.name.Buffer());
ok = false;
}
else {
s.numSigs = numSigs;
s.hrt = 0u;
if (n >= (off + 1u + 8u)) {
memcpy(&s.hrt, &payload[off + 1u], 8u);
}
}
}
else {
REPORT_ERROR(ErrorManagement::ParametersError,
"Source '%s' sent a malformed CONFIG.", s.name.Buffer());
}
return ok;
}
void TCPStreamJoin::OnTapConfig(TCPSServiceStream *source, const uint8 *payload, uint32 payloadSize) {
mtx.FastLock();
const int32 idx = FindByStream(source);
if (idx >= 0) {
Source &s = src[idx];
s.haveBody = false;
s.bodySize = 0u;
configPublished = false;
sizeLogged = false;
s.configOk = ParseConfig(s, payload, payloadSize);
if (s.configOk) {
if (s.cfgBytes < payloadSize) {
if (s.cfg != NULL_PTR(uint8 *)) {
delete[] s.cfg;
}
s.cfg = new uint8[payloadSize];
}
memcpy(s.cfg, payload, payloadSize);
s.cfgBytes = payloadSize;
}
PublishConfigLocked();
}
mtx.FastUnLock();
}
/** Caller holds `mtx`. */
void TCPStreamJoin::PublishConfigLocked() {
configPublished = false;
bool ok = active;
uint64 totalSigs = 0u;
uint64 hrt = UDPS_HRT_FREQUENCY_UNKNOWN;
for (uint32 i = 0u; ok && (i < numSrc); i++) {
ok = src[i].configOk;
totalSigs += src[i].numSigs;
if (ok && (src[i].hrt != UDPS_HRT_FREQUENCY_UNKNOWN)) {
if ((hrt != UDPS_HRT_FREQUENCY_UNKNOWN) && (hrt != src[i].hrt)) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Join '%s': sources have different HRT frequencies, cannot merge.",
outName.Buffer());
ok = false;
}
hrt = src[i].hrt;
}
}
const uint64 cfgSize = 4u + totalSigs * UDPS_SIGNAL_DESC_SIZE + 1u + 8u;
if (ok && (cfgSize > maxPayload)) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Join '%s': merged CONFIG of %u bytes exceeds MaxPayloadSize.",
outName.Buffer(), static_cast<uint32>(cfgSize));
ok = false;
}
if (!ok) {
return;
}
uint8 *buf = new uint8[static_cast<uint32>(cfgSize)];
const uint32 nSigs = static_cast<uint32>(totalSigs);
memcpy(buf, &nSigs, 4u);
uint32 pos = 4u;
uint32 base = 0u;
for (uint32 i = 0u; ok && (i < numSrc); i++) {
const char8 *prefix = src[i].name.Buffer();
for (uint32 k = 0u; ok && (k < src[i].numSigs); k++) {
UDPSSignalDescriptor d;
memcpy(&d, &src[i].cfg[4u + k * UDPS_SIGNAL_DESC_SIZE], UDPS_SIGNAL_DESC_SIZE);
d.name[UDPS_MAX_SIGNAL_NAME - 1u] = '\0';
const uint32 len = static_cast<uint32>(strlen(prefix) + 1u + strlen(d.name));
if (len >= UDPS_MAX_SIGNAL_NAME) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Join '%s': signal name '%s_%s' is longer than %u characters.",
outName.Buffer(), prefix, d.name, UDPS_MAX_SIGNAL_NAME - 1u);
ok = false;
}
else {
char8 merged[UDPS_MAX_SIGNAL_NAME];
(void)snprintf(merged, sizeof(merged), "%s_%s", prefix, d.name);
memset(d.name, 0, sizeof(d.name));
memcpy(d.name, merged, strlen(merged));
if (d.timeSignalIdx != UDPS_NO_TIME_SIGNAL) {
d.timeSignalIdx += base;
}
memcpy(&buf[pos], &d, UDPS_SIGNAL_DESC_SIZE);
pos += UDPS_SIGNAL_DESC_SIZE;
}
}
base += src[i].numSigs;
}
if (ok) {
buf[pos] = UDPS_PUBLISH_STRICT;
pos += 1u;
memcpy(&buf[pos], &hrt, 8u);
pos += 8u;
ok = out->SendConfig(buf, pos);
}
configPublished = ok;
delete[] buf;
}
void TCPStreamJoin::OnTapData(TCPSServiceStream *source, uint32 counter, const uint8 *payload,
uint32 payloadSize) {
(void)counter;
mtx.FastLock();
const int32 idx = FindByStream(source);
if ((idx >= 0) && src[idx].configOk && (payloadSize >= 8u)) {
Source &s = src[idx];
const uint32 bl = payloadSize - 8u;
// A size change without a new CONFIG would corrupt the merged layout: ignore.
if (!s.haveBody || (s.bodySize == bl)) {
if (s.bodyCap < bl) {
if (s.body != NULL_PTR(uint8 *)) {
delete[] s.body;
}
s.body = new uint8[(bl > 0u) ? bl : 1u];
s.bodyCap = (bl > 0u) ? bl : 1u;
}
if (bl > 0u) {
memcpy(s.body, &payload[8], bl);
}
s.bodySize = bl;
s.haveBody = true;
if (active && configPublished && (static_cast<uint32>(idx) == master)) {
uint64 total = 8u;
bool ready = true;
for (uint32 i = 0u; i < numSrc; i++) {
ready = ready && src[i].haveBody;
total += src[i].bodySize;
}
if (ready && (total > maxPayload)) {
if (!sizeLogged) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Join '%s': merged frame of %u bytes exceeds MaxPayloadSize.",
outName.Buffer(), static_cast<uint32>(total));
sizeLogged = true;
}
ready = false;
}
if (ready) {
if (scratchCap < total) {
if (scratch != NULL_PTR(uint8 *)) {
delete[] scratch;
}
scratch = new uint8[static_cast<uint32>(total)];
scratchCap = static_cast<uint32>(total);
}
memcpy(scratch, payload, 8u); // master timestamp
uint32 pos = 8u;
for (uint32 i = 0u; i < numSrc; i++) {
if (src[i].bodySize > 0u) {
memcpy(&scratch[pos], src[i].body, src[i].bodySize);
}
pos += src[i].bodySize;
}
outCounter++;
if (out->SendData(outCounter, scratch, pos)) {
emitted = emitted + 1u;
}
}
}
}
}
mtx.FastUnLock();
}
CLASS_REGISTER(TCPStreamJoin, "1.0")
} /* namespace MARTe */
@@ -0,0 +1,139 @@
#ifndef TCPSTREAMJOIN_H_
#define TCPSTREAMJOIN_H_
/**
* @file TCPStreamJoin.h
* @brief Publishes one new stream of a TCPStreamService that merges several other
* streams of the same service.
*
* @code
* +Svc = { Class = TCPStreamService Port = 44500 }
* +Join = { Class = TCPStreamJoin Service = "Svc" StreamName = "all"
* Sources = "fast,slow" Master = "fast" }
* @endcode
* Declare the join after the service. Consumers subscribe to "all" like to any stream.
*
* The merged stream is emitted at the pace of the Master source: each Master DATA frame
* produces one merged frame holding the Master's signals and the last values received
* from every other source (sample-and-hold). Nothing is emitted until every source has
* delivered one DATA frame. No thread is added: the merged frame is built and queued on
* the Master producer's thread.
*
* @par CONFIG
* Concatenation of the source descriptors in Sources order, named
* "<stream>_<signal>" (at most 63 characters), time-signal indexes rebased, publish mode
* Strict. All sources must share the same HRT frequency (an unknown one matches any).
*
* @par DATA
* [master timestamp][source0 body][source1 body]... where a body is that source's last
* DATA payload without its 8-byte timestamp. A held value is therefore stamped with the
* Master's time unless the source carries its own time signal.
*
* @par Limits
* Only Strict and Decimate sources are accepted (Accumulate batches have varying
* length); a source whose frame size changes without a new CONFIG is ignored; the merged
* frame must fit MaxPayloadSize. The output stream is registered while every source is
* registered and removed as soon as one leaves; it is rebuilt when a source re-registers
* or changes its CONFIG.
*
* @par Parameters
* | Parameter | Type | Default | Description |
* |----------------|--------|-------------|-------------|
* | Service | string | (required) | Name of the TCPStreamService object. |
* | StreamName | string | object name | Name of the merged stream. |
* | Sources | string | (required) | Comma separated source stream names (1..16). |
* | Master | string | first source| Source whose frames pace the merged stream. |
* | MaxPayloadSize | uint32 | 60000 | Largest merged frame payload. |
*
* @par Locking
* Producer-side: source tapMutex, then the join mutex, then the output stream mutex, then
* the connection queue mutex. Service notifications run outside its topology lock and
* are serialised.
*/
#include "FastPollingMutexSem.h"
#include "Object.h"
#include "ReferenceT.h"
#include "StreamString.h"
#include "StructuredDataI.h"
#include "TCPSServiceStream.h"
#include "TCPSStreamTapI.h"
#include "TCPStreamService.h"
namespace MARTe {
class TCPStreamJoin : public Object, public TCPSStreamTapI, public TCPSStreamObserverI {
public:
CLASS_REGISTER_DECLARATION()
/** Most source streams one join can merge. */
static const uint32 TCPSJ_MAX_SOURCES = 16u;
TCPStreamJoin();
virtual ~TCPStreamJoin();
virtual bool Initialise(StructuredDataI &data);
virtual void OnTapConfig(TCPSServiceStream *source, const uint8 *payload, uint32 payloadSize);
virtual void OnTapData(TCPSServiceStream *source, uint32 counter, const uint8 *payload,
uint32 payloadSize);
virtual void OnStreamRegistered(TCPSServiceStream *stream);
virtual void OnStreamUnregistered(TCPSServiceStream *stream);
/** @return true while the merged stream is registered with the service. */
bool IsActive() const;
/** @return true once a merged CONFIG has been published for the current sources. */
bool HasConfig() const;
/** @return merged DATA frames emitted. */
uint64 GetFramesEmitted() const;
uint32 GetNumSources() const;
private:
struct Source {
Source();
~Source();
StreamString name;
TCPSServiceStream *stream; ///< non-NULL while registered and tapped
bool configOk;
uint8 *cfg;
uint32 cfgBytes;
uint32 numSigs;
uint64 hrt;
uint8 *body;
uint32 bodyCap;
uint32 bodySize;
bool haveBody;
};
int32 FindByName(const char8 *name) const;
int32 FindByStream(const TCPSServiceStream *s) const;
bool AllRegistered() const;
void Evaluate();
void PublishConfigLocked();
bool ParseConfig(Source &s, const uint8 *payload, uint32 n);
ReferenceT<TCPStreamService> service;
TCPSServiceStream *out;
bool observing;
StreamString outName;
Source *src;
uint32 numSrc;
uint32 master;
uint32 maxPayload;
FastPollingMutexSem mtx;
bool active;
bool configPublished;
bool sizeLogged;
uint32 outCounter;
volatile uint64 emitted;
uint8 *scratch;
uint32 scratchCap;
TCPStreamJoin(const TCPStreamJoin &);
TCPStreamJoin &operator=(const TCPStreamJoin &);
};
} // namespace MARTe
#endif // TCPSTREAMJOIN_H_
@@ -0,0 +1,502 @@
/**
* @file TCPStreamService.cpp
* @brief Source file for class TCPStreamService
* @date 06/11/2026
* @author Martino Ferrari
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*/
#define DLL_API
#include "TCPStreamService.h"
#include "AdvancedErrorManagement.h"
#include "Atomic.h"
#include "HighResolutionTimer.h"
#include "TCPSConn.h"
#include "TCPSServiceStream.h"
#include "TCPSWorker.h"
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <poll.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
namespace MARTe {
static const int TCPS_ACCEPT_SLICE_MS = 50;
TCPStreamService::TCPStreamService()
: Object(), EmbeddedServiceMethodBinderI(), port(44500u), boundPort(0u),
numWorkers(2u), maxClients(64u), maxStreams(32u), queueDepth(8u),
stallTimeoutS(5u), handshakeTimeoutS(5u), sendBufferSize(0u),
cpuMask(0xFFFFFFFFu), stackSize(65536u), stallTicks(0u), handshakeTicks(0u),
listenFd(-1), acceptThread(*this), acceptorStarted(false),
workers(NULL_PTR(TCPSWorker **)), workersCreated(0u),
numObservers(0u),
streams(NULL_PTR(TCPSServiceStream **)), numStreams(0u),
connCount(0), evictions(0), rejected(0) {
(void)notifyMutex.Create(true);
for (uint32 i = 0u; i < TCPS_MAX_OBSERVERS; i++) {
observers[i] = NULL_PTR(TCPSStreamObserverI *);
}
}
TCPStreamService::~TCPStreamService() {
Shutdown();
}
void TCPStreamService::Shutdown() {
if (acceptorStarted) {
(void)acceptThread.Stop();
acceptorStarted = false;
}
for (uint32 i = 0u; i < workersCreated; i++) {
workers[i]->Stop();
}
if (listenFd >= 0) {
(void)close(listenFd);
listenFd = -1;
}
for (uint32 i = 0u; i < workersCreated; i++) {
delete workers[i];
}
workersCreated = 0u;
if (workers != NULL_PTR(TCPSWorker **)) {
delete[] workers;
workers = NULL_PTR(TCPSWorker **);
}
if (streams != NULL_PTR(TCPSServiceStream **)) {
delete[] streams;
streams = NULL_PTR(TCPSServiceStream **);
}
numStreams = 0u;
}
bool TCPStreamService::Initialise(StructuredDataI &data) {
bool ok = Object::Initialise(data);
port = 44500u;
(void)data.Read("Port", port);
if (port > 65535u) {
REPORT_ERROR(ErrorManagement::ParametersError, "Port %u out of range.", port);
ok = false;
}
numWorkers = 2u;
(void)data.Read("Workers", numWorkers);
if ((numWorkers == 0u) || (numWorkers > 32u)) {
REPORT_ERROR(ErrorManagement::ParametersError, "Workers %u must be in 1..32.", numWorkers);
ok = false;
}
maxClients = 64u;
(void)data.Read("MaxClients", maxClients);
if ((maxClients == 0u) || (maxClients > 1024u)) {
REPORT_ERROR(ErrorManagement::ParametersError, "MaxClients %u must be in 1..1024.", maxClients);
ok = false;
}
maxStreams = 32u;
(void)data.Read("MaxStreams", maxStreams);
if ((maxStreams == 0u) || (maxStreams > 256u)) {
REPORT_ERROR(ErrorManagement::ParametersError, "MaxStreams %u must be in 1..256.", maxStreams);
ok = false;
}
queueDepth = 8u;
(void)data.Read("ClientQueueDepth", queueDepth);
if ((queueDepth == 0u) || (queueDepth > 4096u)) {
REPORT_ERROR(ErrorManagement::ParametersError, "ClientQueueDepth %u must be in 1..4096.", queueDepth);
ok = false;
}
stallTimeoutS = 5u;
(void)data.Read("ClientStallTimeout", stallTimeoutS);
handshakeTimeoutS = 5u;
(void)data.Read("HandshakeTimeout", handshakeTimeoutS);
if (handshakeTimeoutS == 0u) {
REPORT_ERROR(ErrorManagement::ParametersError, "HandshakeTimeout must be at least 1 second.");
ok = false;
}
sendBufferSize = 0u;
(void)data.Read("SendBufferSize", sendBufferSize);
(void)data.Read("CPUMask", cpuMask);
(void)data.Read("StackSize", stackSize);
stallTicks = static_cast<uint64>(stallTimeoutS) * HighResolutionTimer::Frequency();
handshakeTicks = static_cast<uint64>(handshakeTimeoutS) * HighResolutionTimer::Frequency();
if (!ok) {
return false;
}
/* Listening socket. */
int fd = socket(AF_INET, SOCK_STREAM, 0);
ok = (fd >= 0);
if (!ok) {
REPORT_ERROR(ErrorManagement::FatalError, "socket() failed: %s.", strerror(errno));
}
if (ok) {
int one = 1;
(void)setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons(static_cast<uint16>(port));
if (bind(fd, reinterpret_cast<struct sockaddr *>(&addr), sizeof(addr)) != 0) {
REPORT_ERROR(ErrorManagement::FatalError, "bind(%u) failed: %s.", port, strerror(errno));
ok = false;
}
}
if (ok && (listen(fd, 32) != 0)) {
REPORT_ERROR(ErrorManagement::FatalError, "listen() failed: %s.", strerror(errno));
ok = false;
}
if (ok) {
int flags = fcntl(fd, F_GETFL, 0);
ok = (flags >= 0) && (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
}
if (ok) {
struct sockaddr_in addr;
socklen_t len = static_cast<socklen_t>(sizeof(addr));
memset(&addr, 0, sizeof(addr));
boundPort = static_cast<uint16>(port);
if (getsockname(fd, reinterpret_cast<struct sockaddr *>(&addr), &len) == 0) {
boundPort = ntohs(addr.sin_port);
}
}
if (!ok) {
if (fd >= 0) {
(void)close(fd);
}
return false;
}
listenFd = fd;
streams = new TCPSServiceStream *[maxStreams];
workers = new TCPSWorker *[numWorkers];
for (uint32 i = 0u; (i < numWorkers) && ok; i++) {
workers[i] = new TCPSWorker(*this, maxClients);
workersCreated = i + 1u;
ok = workers[i]->Start(cpuMask, stackSize);
if (!ok) {
REPORT_ERROR(ErrorManagement::FatalError, "Could not start worker %u.", i);
}
}
if (ok) {
acceptThread.SetCPUMask(cpuMask);
acceptThread.SetStackSize(stackSize);
ok = (acceptThread.Start() == ErrorManagement::NoError);
acceptorStarted = ok;
if (!ok) {
REPORT_ERROR(ErrorManagement::FatalError, "Could not start the acceptor thread.");
}
}
if (!ok) {
Shutdown();
}
return ok;
}
ErrorManagement::ErrorType TCPStreamService::Execute(ExecutionInfo &info) {
if (info.GetStage() != ExecutionInfo::MainStage) {
return ErrorManagement::NoError;
}
struct pollfd p;
p.fd = listenFd;
p.events = POLLIN;
p.revents = 0;
if (poll(&p, 1, TCPS_ACCEPT_SLICE_MS) <= 0) {
return ErrorManagement::NoError;
}
for (;;) {
int fd = accept(listenFd, NULL_PTR(struct sockaddr *), NULL_PTR(socklen_t *));
if (fd < 0) {
break;
}
if (static_cast<uint32>(connCount) >= maxClients) {
REPORT_ERROR(ErrorManagement::Warning,
"MaxClients (%u) reached; connection refused.", maxClients);
(void)close(fd);
continue;
}
int flags = fcntl(fd, F_GETFL, 0);
if ((flags < 0) || (fcntl(fd, F_SETFL, flags | O_NONBLOCK) != 0)) {
(void)close(fd);
continue;
}
int one = 1;
(void)setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one));
if (sendBufferSize > 0u) {
int sz = static_cast<int>(sendBufferSize);
(void)setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sz, sizeof(sz));
}
TCPSWorker *best = workers[0];
for (uint32 i = 1u; i < workersCreated; i++) {
if (workers[i]->Load() < best->Load()) {
best = workers[i];
}
}
TCPSConn *c = new TCPSConn(fd, best, queueDepth,
HighResolutionTimer::Counter() + handshakeTicks);
Atomic::Increment(&connCount);
if (!best->AddIncoming(c)) {
delete c;
Atomic::Decrement(&connCount);
}
}
return ErrorManagement::NoError;
}
uint16 TCPStreamService::GetBoundPort() const {
return boundPort;
}
uint32 TCPStreamService::GetClientCount() const {
uint32 n = 0u;
topology.FastLock();
for (uint32 i = 0u; i < numStreams; i++) {
n += streams[i]->GetClientCount();
}
topology.FastUnLock();
return n;
}
uint32 TCPStreamService::GetStreamCount() const {
return numStreams;
}
uint32 TCPStreamService::GetWorkerCount() const {
return workersCreated;
}
uint64 TCPStreamService::GetClientDrops() const {
uint64 n = 0u;
topology.FastLock();
for (uint32 i = 0u; i < numStreams; i++) {
n += streams[i]->GetClientDrops();
}
topology.FastUnLock();
return n;
}
uint32 TCPStreamService::GetStallEvictions() const {
return static_cast<uint32>(evictions);
}
uint32 TCPStreamService::GetRejectedSubscriptions() const {
return static_cast<uint32>(rejected);
}
bool TCPStreamService::RegisterStream(TCPSServiceStream *s) {
bool ok = true;
// Held across the registration so observers see (un)registrations in order.
(void)notifyMutex.Lock();
topology.FastLock();
if (numStreams >= maxStreams) {
REPORT_ERROR(ErrorManagement::ParametersError,
"Cannot register stream '%s': MaxStreams (%u) reached.",
s->GetStreamName(), maxStreams);
ok = false;
}
for (uint32 i = 0u; (i < numStreams) && ok; i++) {
if (strcmp(streams[i]->GetStreamName(), s->GetStreamName()) == 0) {
REPORT_ERROR(ErrorManagement::ParametersError,
"A stream named '%s' is already registered.", s->GetStreamName());
ok = false;
}
}
if (ok) {
streams[numStreams] = s;
numStreams++;
}
topology.FastUnLock();
if (ok) {
for (uint32 i = 0u; i < numObservers; i++) {
observers[i]->OnStreamRegistered(s);
}
}
(void)notifyMutex.UnLock();
return ok;
}
void TCPStreamService::UnregisterStream(TCPSServiceStream *s) {
(void)notifyMutex.Lock();
bool wasRegistered = false;
topology.FastLock();
for (uint32 i = 0u; i < numStreams; i++) {
if (streams[i] == s) {
streams[i] = streams[numStreams - 1u];
numStreams--;
wasRegistered = true;
break;
}
}
s->DropAllConns();
topology.FastUnLock();
if (wasRegistered) {
for (uint32 i = 0u; i < numObservers; i++) {
observers[i]->OnStreamUnregistered(s);
}
}
(void)notifyMutex.UnLock();
}
bool TCPStreamService::AddObserver(TCPSStreamObserverI *obs) {
bool ok = false;
(void)notifyMutex.Lock();
if (numObservers < TCPS_MAX_OBSERVERS) {
observers[numObservers] = obs;
numObservers++;
ok = true;
// Replay: streams cannot (un)register while notifyMutex is held.
topology.FastLock();
const uint32 n = numStreams;
TCPSServiceStream **snap = new TCPSServiceStream *[(n > 0u) ? n : 1u];
for (uint32 i = 0u; i < n; i++) {
snap[i] = streams[i];
}
topology.FastUnLock();
for (uint32 i = 0u; i < n; i++) {
obs->OnStreamRegistered(snap[i]);
}
delete[] snap;
}
(void)notifyMutex.UnLock();
return ok;
}
void TCPStreamService::RemoveObserver(TCPSStreamObserverI *obs) {
(void)notifyMutex.Lock();
for (uint32 i = 0u; i < numObservers; i++) {
if (observers[i] == obs) {
observers[i] = observers[numObservers - 1u];
numObservers--;
break;
}
}
(void)notifyMutex.UnLock();
}
bool TCPStreamService::Attach(TCPSConn *c, char8 *streamList) {
TCPSServiceStream *found[TCPS_MAX_CONN_STREAMS];
uint32 n = 0u;
bool ok = true;
topology.FastLock();
char8 *p = streamList;
while (ok) {
char8 *comma = strchr(p, ',');
if (comma != NULL_PTR(char8 *)) {
*comma = '\0';
}
const uint32 len = static_cast<uint32>(strlen(p));
TCPSServiceStream *match = NULL_PTR(TCPSServiceStream *);
if ((len == 0u) || (len > TCPS_MAX_STREAM_NAME) || (n >= TCPS_MAX_CONN_STREAMS)) {
ok = false;
}
for (uint32 i = 0u; ok && (i < numStreams) && (match == NULL_PTR(TCPSServiceStream *)); i++) {
if (strcmp(streams[i]->GetStreamName(), p) == 0) {
match = streams[i];
}
}
for (uint32 i = 0u; ok && (i < n); i++) {
if (found[i] == match) {
ok = false; // the same stream listed twice
}
}
if (ok && (match == NULL_PTR(TCPSServiceStream *))) {
ok = false;
}
if (ok) {
found[n] = match;
n++;
if (comma == NULL_PTR(char8 *)) {
break;
}
p = comma + 1;
}
}
if (ok) {
c->qMutex.FastLock();
c->q.Reserve(n);
c->qMutex.FastUnLock();
uint32 attached = 0u;
for (uint32 i = 0u; ok && (i < n); i++) {
ok = found[i]->AttachConn(c, static_cast<uint16>(i));
if (ok) {
attached++;
}
}
if (!ok) {
for (uint32 i = 0u; i < attached; i++) {
found[i]->DetachConn(c);
}
} else {
for (uint32 i = 0u; i < n; i++) {
c->streams[i] = found[i];
}
c->numStreams = n;
}
}
topology.FastUnLock();
return ok;
}
void TCPStreamService::Detach(TCPSConn *c) {
topology.FastLock();
for (uint32 i = 0u; i < c->numStreams; i++) {
if (c->streams[i] != NULL_PTR(TCPSServiceStream *)) {
c->streams[i]->DetachConn(c);
c->streams[i] = NULL_PTR(TCPSServiceStream *);
}
}
topology.FastUnLock();
}
void TCPStreamService::ConnClosed() {
Atomic::Decrement(&connCount);
}
void TCPStreamService::NoteEviction() {
Atomic::Increment(&evictions);
}
void TCPStreamService::NoteRejected() {
Atomic::Increment(&rejected);
}
uint32 TCPStreamService::QueueDepth() const {
return queueDepth;
}
uint64 TCPStreamService::StallTicks() const {
return stallTicks;
}
uint64 TCPStreamService::HandshakeTicks() const {
return handshakeTicks;
}
uint32 TCPStreamService::MaxClients() const {
return maxClients;
}
CLASS_REGISTER(TCPStreamService, "1.0")
} // namespace MARTe
@@ -0,0 +1,174 @@
#ifndef TCPSTREAMSERVICE_H_
#define TCPSTREAMSERVICE_H_
/**
* @file TCPStreamService.h
* @brief One in-process TCP streaming server shared by any number of
* TCPStreamer DataSources, served by a pool of worker threads.
*
* @details Declared once, at the root of the configuration:
* <pre>
* +StreamService = {
* Class = TCPStreamService
* Port = 44500
* Workers = 2
* }
* </pre>
* and referenced from any number of DataSources:
* <pre>
* +Fast = { Class = TCPStreamer Service = StreamService StreamName = Fast ... }
* +Slow = { Class = TCPStreamer Service = StreamService StreamName = Slow ... }
* </pre>
*
* Wire protocol: plain UDPS framing over TCP, exactly like TCPSServer, plus one
* client-to-server frame. Right after connecting, a client sends a SUBSCRIBE
* frame (UDPS_TYPE_SUBSCRIBE, payload = stream name, 1..255 bytes). The service
* then sends that stream's CONFIG followed by its DATA frames. One connection =
* one stream. A connection that does not subscribe within HandshakeTimeout
* seconds, or that names an unknown stream, is closed (clients retry).
*
* Threads: one acceptor plus `Workers` I/O threads. A connection lives on one
* worker. Producer threads never touch sockets: they copy each frame into every
* subscriber's bounded queue and poke the owning worker through a self-pipe, so
* a slow client only loses its own frames and never delays a producer or
* another client.
*
* @par Parameters (all optional)
* | Parameter | Type | Default | Description |
* |--------------------|--------|---------|-------------|
* | Port | uint32 | 44500 | TCP listen port; 0 = ephemeral (see GetBoundPort()). |
* | Workers | uint32 | 2 | I/O threads (1..32). |
* | MaxClients | uint32 | 64 | Simultaneous connections (1..1024). |
* | MaxStreams | uint32 | 32 | Registered streams (1..256). |
* | ClientQueueDepth | uint32 | 8 | DATA frames queued per client (1..4096). |
* | ClientStallTimeout | uint32 | 5 | Seconds without progress before eviction; 0 disables. |
* | HandshakeTimeout | uint32 | 5 | Seconds allowed to send SUBSCRIBE. |
* | SendBufferSize | uint32 | 0 | SO_SNDBUF for client sockets; 0 keeps the OS default. |
* | CPUMask | uint32 | 0xFFFFFFFF | Affinity of the service threads. |
* | StackSize | uint32 | 65536 | Stack of the service threads. |
*/
#include "EmbeddedServiceMethodBinderI.h"
#include "ExecutionInfo.h"
#include "FastPollingMutexSem.h"
#include "MutexSem.h"
#include "Object.h"
#include "SingleThreadService.h"
#include "StructuredDataI.h"
#include "TCPSStreamTapI.h"
#include "UDPSProtocol.h"
namespace MARTe {
class TCPSWorker;
class TCPSServiceStream;
struct TCPSConn;
/** Longest stream name accepted in a SUBSCRIBE frame. */
static const uint32 TCPS_MAX_STREAM_NAME = 255u;
/** Most streams one connection may multiplex. */
static const uint32 TCPS_MAX_CONN_STREAMS = UDPS_TCP_MAX_STREAMS;
/** Longest SUBSCRIBE payload: a comma separated list of stream names. */
static const uint32 TCPS_MAX_SUBSCRIBE_PAYLOAD = UDPS_TCP_MAX_SUBSCRIBE_PAYLOAD;
class TCPStreamService : public Object, public EmbeddedServiceMethodBinderI {
public:
CLASS_REGISTER_DECLARATION()
TCPStreamService();
virtual ~TCPStreamService();
/** Reads the parameters, opens the listening socket and starts the threads. */
virtual bool Initialise(StructuredDataI &data);
/** Acceptor thread entry point; do not call directly. */
virtual ErrorManagement::ErrorType Execute(ExecutionInfo &info);
/** @return the port actually bound. */
uint16 GetBoundPort() const;
/** @return subscribed connections across all streams. */
uint32 GetClientCount() const;
uint32 GetStreamCount() const;
uint32 GetWorkerCount() const;
/** @return DATA frames dropped for slow clients, summed over registered streams. */
uint64 GetClientDrops() const;
/** @return connections closed by the stall timeout (all time). */
uint32 GetStallEvictions() const;
/** @return connections closed for a bad / unknown SUBSCRIBE (all time). */
uint32 GetRejectedSubscriptions() const;
/* ---- stream side ---- */
/** @return false if a stream with this name is already registered or the table is full. */
bool RegisterStream(TCPSServiceStream *s);
/** Remove the stream and make its subscribers close. */
void UnregisterStream(TCPSServiceStream *s);
/**
* Be told when streams register / unregister. The streams already registered are
* replayed to the observer before AddObserver returns. Notifications are serialised
* (and may nest on one thread), they never run under the topology lock, and once
* RemoveObserver returns no callback is running or will start.
* @return false if the observer table is full.
*/
bool AddObserver(TCPSStreamObserverI *obs);
void RemoveObserver(TCPSStreamObserverI *obs);
/* ---- worker side (internal) ---- */
/**
* Bind a connection to the streams named in @p streamList (comma separated,
* modified in place). The position in the list is the stream index stamped
* on every frame. All-or-nothing: @return false if any name is unknown,
* duplicated or malformed.
*/
bool Attach(TCPSConn *c, char8 *streamList);
void Detach(TCPSConn *c);
void ConnClosed();
void NoteEviction();
void NoteRejected();
uint32 QueueDepth() const;
uint64 StallTicks() const;
uint64 HandshakeTicks() const;
/** Max subscribers a stream may hold. */
uint32 MaxClients() const;
private:
void Shutdown();
uint32 port;
uint16 boundPort;
uint32 numWorkers;
uint32 maxClients;
uint32 maxStreams;
uint32 queueDepth;
uint32 stallTimeoutS;
uint32 handshakeTimeoutS;
uint32 sendBufferSize;
uint32 cpuMask;
uint32 stackSize;
uint64 stallTicks;
uint64 handshakeTicks;
int listenFd;
SingleThreadService acceptThread;
bool acceptorStarted;
TCPSWorker **workers;
uint32 workersCreated;
/** Most observers (TCPStreamJoin objects) one service can feed. */
static const uint32 TCPS_MAX_OBSERVERS = 16u;
MutexSem notifyMutex; ///< recursive; serialises observer calls with (un)registration
TCPSStreamObserverI *observers[TCPS_MAX_OBSERVERS];
uint32 numObservers;
mutable FastPollingMutexSem topology; ///< guards streams[] and every TCPSConn::stream
TCPSServiceStream **streams;
uint32 numStreams;
volatile int32 connCount;
volatile int32 evictions;
volatile int32 rejected;
};
} // namespace MARTe
#endif // TCPSTREAMSERVICE_H_
@@ -0,0 +1,353 @@
../../../..//Build/x86-linux/Components/Interfaces/TCPStreamService/TCPSFrameQueue.o: TCPSFrameQueue.cpp TCPSFrameQueue.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h
../../../..//Build/x86-linux/Components/Interfaces/TCPStreamService/TCPSServiceStream.o: TCPSServiceStream.cpp TCPSServiceStream.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Common/UDP/UDPSProtocol.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
TCPSConn.h TCPSFrameQueue.h TCPSWorker.h
../../../..//Build/x86-linux/Components/Interfaces/TCPStreamService/TCPStreamService.o: TCPStreamService.cpp TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Common/UDP/UDPSProtocol.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
TCPSConn.h TCPSFrameQueue.h TCPSServiceStream.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
TCPSWorker.h
../../../..//Build/x86-linux/Components/Interfaces/TCPStreamService/TCPSWorker.o: TCPSWorker.cpp TCPSWorker.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
TCPSConn.h TCPSFrameQueue.h TCPStreamService.h \
../../../..//Common/UDP/UDPSProtocol.h
@@ -0,0 +1,353 @@
TCPSFrameQueue.o: TCPSFrameQueue.cpp TCPSFrameQueue.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h
TCPSServiceStream.o: TCPSServiceStream.cpp TCPSServiceStream.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Common/UDP/UDPSProtocol.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
TCPSConn.h TCPSFrameQueue.h TCPSWorker.h
TCPStreamService.o: TCPStreamService.cpp TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../..//Common/UDP/UDPSProtocol.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
TCPSConn.h TCPSFrameQueue.h TCPSServiceStream.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
../../../..//Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
TCPSWorker.h
TCPSWorker.o: TCPSWorker.cpp TCPSWorker.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
TCPSConn.h TCPSFrameQueue.h TCPStreamService.h \
../../../..//Common/UDP/UDPSProtocol.h
@@ -1,7 +1,7 @@
#############################################################
# MARTe2 Integrated Components — UDPStream
#############################################################
OBJSX=UDPSServer.x UDPSClient.x
OBJSX=UDPSServer.x UDPSClient.x TCPSServer.x TCPSClient.x
PACKAGE=Components/Interfaces
@@ -0,0 +1,517 @@
/**
* @file TCPSClient.cpp
* @brief Implementation of TCPSClient — UDPS framing over TCP, consumer side.
*/
#include "TCPSClient.h"
#include "AdvancedErrorManagement.h"
#include "ErrorType.h"
#include "HighResolutionTimer.h"
#include "Sleep.h"
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <poll.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
namespace MARTe {
const uint32 TCPSClient::TCPS_CLIENT_DEFAULT_RECONNECT_DELAY_S;
/** Longest single wait inside Execute(), so Stop() is prompt. */
static const int TCPS_CLIENT_SLICE_MS = 50;
/** Total time allowed for one connect() attempt. */
static const int TCPS_CLIENT_CONNECT_TIMEOUT_MS = 2000;
TCPSClient::TCPSClient()
: serverPort(0u), silenceTimeoutTicks(0u), reconnectDelayTicks(0u),
cpuMask(0xFFFFFFFFu), stackSize(65536u),
numStreams(1u), startRefs(0u), threadService(*this), fd(-1),
connected(false), stopping(false), lastDataTicks(0u), disconnectTick(0u),
connectionCount(0u), protocolErrors(0u), rxBuf(NULL_PTR(uint8 *)),
rxHave(0u), rxWant(UDPS_HEADER_SIZE), rxHeaderOk(false)
{
for (uint32 i = 0u; i < UDPS_TCP_MAX_STREAMS; i++) {
listeners[i] = NULL_PTR(UDPSClientListener *);
facades[i] = NULL_PTR(TCPSClientStream *);
lastDataCounter[i] = 0u;
lastDataCounterValid[i] = false;
lastDataGap[i] = 0u;
}
reconnectDelayTicks = static_cast<uint64>(TCPS_CLIENT_DEFAULT_RECONNECT_DELAY_S) *
HighResolutionTimer::Frequency();
}
TCPSClient::~TCPSClient() {
(void)Stop();
for (uint32 i = 0u; i < UDPS_TCP_MAX_STREAMS; i++) {
if (facades[i] != NULL_PTR(TCPSClientStream *)) {
delete facades[i];
facades[i] = NULL_PTR(TCPSClientStream *);
}
}
if (rxBuf != NULL_PTR(uint8 *)) {
delete[] rxBuf;
rxBuf = NULL_PTR(uint8 *);
}
}
bool TCPSClient::Initialise(StructuredDataI &data) {
bool ok = true;
if (!data.Read("ServerAddr", serverAddr) || (serverAddr.Size() == 0u)) {
serverAddr = "127.0.0.1";
}
if (!data.Read("Port", serverPort) || (serverPort == 0u) || (serverPort > 65535u)) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSClient: a valid Port (1..65535) is required.");
ok = false;
}
streamName = "";
numStreams = 1u;
if (data.Read("StreamName", streamName)) {
ok = ParseStreamList();
}
float32 silence = 0.0f;
(void)data.Read("SilenceTimeout", silence);
if (silence < 0.0f) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSClient: SilenceTimeout must be >= 0.");
ok = false;
silence = 0.0f;
}
silenceTimeoutTicks = static_cast<uint64>(
static_cast<float64>(silence) * static_cast<float64>(HighResolutionTimer::Frequency()));
float32 delay = static_cast<float32>(TCPS_CLIENT_DEFAULT_RECONNECT_DELAY_S);
(void)data.Read("ReconnectDelay", delay);
if (delay < 0.0f) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSClient: ReconnectDelay must be >= 0.");
ok = false;
delay = 0.0f;
}
reconnectDelayTicks = static_cast<uint64>(
static_cast<float64>(delay) * static_cast<float64>(HighResolutionTimer::Frequency()));
(void)data.Read("CPUMask", cpuMask);
(void)data.Read("StackSize", stackSize);
return ok;
}
/** Validate streamName as "a" or "a,b,c" and set numStreams. */
bool TCPSClient::ParseStreamList() {
bool ok = (streamName.Size() <= UDPS_TCP_MAX_SUBSCRIBE_PAYLOAD);
const char8 *s = streamName.Buffer();
uint32 n = 0u;
while (ok && (s != NULL_PTR(const char8 *)) && (streamName.Size() > 0u)) {
const char8 *comma = strchr(s, ',');
const uint32 len = (comma != NULL_PTR(const char8 *)) ? static_cast<uint32>(comma - s)
: static_cast<uint32>(strlen(s));
ok = (len > 0u) && (len <= 255u) && (n < UDPS_TCP_MAX_STREAMS);
// Duplicates would be refused by the server; catch them here.
const char8 *t = streamName.Buffer();
for (uint32 k = 0u; ok && (k < n); k++) {
const char8 *tc = strchr(t, ',');
const uint32 tl = (tc != NULL_PTR(const char8 *)) ? static_cast<uint32>(tc - t)
: static_cast<uint32>(strlen(t));
if ((tl == len) && (strncmp(t, s, len) == 0)) {
ok = false;
}
t = (tc != NULL_PTR(const char8 *)) ? (tc + 1) : t;
}
n++;
s = (comma != NULL_PTR(const char8 *)) ? (comma + 1) : NULL_PTR(const char8 *);
}
if (!ok) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSClient: StreamName must be 1..%u distinct names (1..255 chars each, "
"comma separated, %u bytes max).", UDPS_TCP_MAX_STREAMS,
UDPS_TCP_MAX_SUBSCRIBE_PAYLOAD);
} else if (n > 0u) {
numStreams = n;
}
return ok;
}
void TCPSClient::SetListener(UDPSClientListener *newListener) {
listeners[0] = newListener;
}
void TCPSClient::SetStreamListener(uint32 index, UDPSClientListener *newListener) {
if (index < UDPS_TCP_MAX_STREAMS) {
listeners[index] = newListener;
}
}
uint32 TCPSClient::GetNumStreams() const {
return numStreams;
}
UDPSClientI *TCPSClient::GetStream(uint32 index) {
if (index >= numStreams) {
return NULL_PTR(UDPSClientI *);
}
if (facades[index] == NULL_PTR(TCPSClientStream *)) {
facades[index] = new TCPSClientStream(*this, index);
}
return facades[index];
}
uint32 TCPSClient::GetStreamDataGap(uint32 index) const {
return (index < UDPS_TCP_MAX_STREAMS) ? lastDataGap[index] : 0u;
}
bool TCPSClient::AcquireStart() {
bool ok = true;
refMutex.FastLock();
if (startRefs == 0u) {
ok = Start();
}
if (ok) {
startRefs++;
}
refMutex.FastUnLock();
return ok;
}
bool TCPSClient::ReleaseStop() {
bool ok = true;
refMutex.FastLock();
if (startRefs > 0u) {
startRefs--;
if (startRefs == 0u) {
ok = Stop();
}
}
refMutex.FastUnLock();
return ok;
}
TCPSClientStream::TCPSClientStream(TCPSClient &o, uint32 i) : owner(o), index(i), started(false) {
}
TCPSClientStream::~TCPSClientStream() {
(void)Stop();
}
bool TCPSClientStream::Initialise(StructuredDataI &data) {
(void)data;
return true;
}
void TCPSClientStream::SetListener(UDPSClientListener *newListener) {
owner.SetStreamListener(index, newListener);
}
bool TCPSClientStream::Start() {
bool ok = true;
if (!started) {
ok = owner.AcquireStart();
started = ok;
}
return ok;
}
bool TCPSClientStream::Stop() {
bool ok = true;
if (started) {
started = false;
ok = owner.ReleaseStop();
}
return ok;
}
uint32 TCPSClientStream::GetLastDataGap() const {
return owner.GetStreamDataGap(index);
}
bool TCPSClient::Start() {
if (rxBuf == NULL_PTR(uint8 *)) {
rxBuf = new uint8[UDPS_HEADER_SIZE + UDPSClient::UDPS_CLIENT_MAX_PACKET_BYTES];
}
stopping = false;
connectionCount = 0u;
disconnectTick = 0u;
threadService.SetCPUMask(cpuMask);
threadService.SetStackSize(stackSize);
ErrorManagement::ErrorType err = threadService.Start();
return (err == ErrorManagement::NoError);
}
bool TCPSClient::Stop() {
stopping = true;
ErrorManagement::ErrorType err = threadService.Stop();
Disconnect();
return (err == ErrorManagement::NoError);
}
bool TCPSClient::IsConnected() const {
return connected;
}
uint32 TCPSClient::GetLastDataGap() const {
return lastDataGap[0];
}
uint32 TCPSClient::GetConnectionCount() const {
return connectionCount;
}
uint32 TCPSClient::GetProtocolErrors() const {
return protocolErrors;
}
// ---------------------------------------------------------------------------
// Thread entry
// ---------------------------------------------------------------------------
ErrorManagement::ErrorType TCPSClient::Execute(ExecutionInfo &info) {
if (info.GetStage() == ExecutionInfo::TerminationStage) {
Disconnect();
return ErrorManagement::NoError;
}
if (info.GetStage() != ExecutionInfo::MainStage) {
return ErrorManagement::NoError;
}
if (!connected) {
const uint64 now = HighResolutionTimer::Counter();
if ((disconnectTick == 0u) || ((now - disconnectTick) >= reconnectDelayTicks)) {
if (!Connect()) {
disconnectTick = HighResolutionTimer::Counter();
}
} else {
Sleep::MSec(10u);
}
return ErrorManagement::NoError;
}
if (!ReceiveStep()) {
Disconnect();
return ErrorManagement::NoError;
}
if (silenceTimeoutTicks > 0u) {
const uint64 now = HighResolutionTimer::Counter();
if ((now > lastDataTicks) && ((now - lastDataTicks) >= silenceTimeoutTicks)) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPSClient: server silent; reconnecting.");
Disconnect();
}
}
return ErrorManagement::NoError;
}
// ---------------------------------------------------------------------------
// Connection management
// ---------------------------------------------------------------------------
bool TCPSClient::Connect() {
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(static_cast<uint16>(serverPort));
if (inet_pton(AF_INET, serverAddr.Buffer(), &addr.sin_addr) != 1) {
struct addrinfo hints;
struct addrinfo *res = NULL_PTR(struct addrinfo *);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
if ((getaddrinfo(serverAddr.Buffer(), NULL_PTR(const char8 *), &hints, &res) != 0) ||
(res == NULL_PTR(struct addrinfo *))) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPSClient: cannot resolve '%s'.", serverAddr.Buffer());
return false;
}
addr.sin_addr = reinterpret_cast<struct sockaddr_in *>(res->ai_addr)->sin_addr;
freeaddrinfo(res);
}
int s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0) {
return false;
}
int flags = fcntl(s, F_GETFL, 0);
if ((flags < 0) || (fcntl(s, F_SETFL, flags | O_NONBLOCK) != 0)) {
(void)close(s);
return false;
}
bool ok = true;
int r = connect(s, reinterpret_cast<struct sockaddr *>(&addr), sizeof(addr));
if ((r != 0) && (errno == EINPROGRESS)) {
ok = false;
for (int waited = 0; (waited < TCPS_CLIENT_CONNECT_TIMEOUT_MS) && !stopping;
waited += TCPS_CLIENT_SLICE_MS) {
struct pollfd p;
p.fd = s;
p.events = POLLOUT;
p.revents = 0;
int pr = poll(&p, 1, TCPS_CLIENT_SLICE_MS);
if (pr > 0) {
int soErr = 0;
socklen_t len = static_cast<socklen_t>(sizeof(soErr));
ok = (getsockopt(s, SOL_SOCKET, SO_ERROR, &soErr, &len) == 0) && (soErr == 0);
break;
}
if ((pr < 0) && (errno != EINTR)) {
break;
}
}
} else if (r != 0) {
ok = false;
}
if (!ok) {
(void)close(s);
return false;
}
if (streamName.Size() > 0u) {
// A few dozen bytes on a fresh socket: never blocks.
uint8 sub[UDPS_HEADER_SIZE + UDPS_TCP_MAX_SUBSCRIBE_PAYLOAD];
const uint32 n = static_cast<uint32>(streamName.Size());
UDPSBuildHeader(sub, UDPS_TYPE_SUBSCRIBE, 0u, 0u, 1u, n);
memcpy(&sub[UDPS_HEADER_SIZE], streamName.Buffer(), n);
if (send(s, sub, UDPS_HEADER_SIZE + n, MSG_NOSIGNAL) != static_cast<ssize_t>(UDPS_HEADER_SIZE + n)) {
(void)close(s);
return false;
}
}
fd = s;
rxHave = 0u;
rxWant = UDPS_HEADER_SIZE;
rxHeaderOk = false;
for (uint32 i = 0u; i < UDPS_TCP_MAX_STREAMS; i++) {
lastDataCounterValid[i] = false;
}
lastDataTicks = HighResolutionTimer::Counter();
connectionCount++;
connected = true;
for (uint32 i = 0u; i < numStreams; i++) {
if (listeners[i] != NULL_PTR(UDPSClientListener *)) {
listeners[i]->OnUDPSConnected();
}
}
return true;
}
void TCPSClient::Disconnect() {
const bool was = connected;
connected = false;
if (fd >= 0) {
(void)close(fd);
fd = -1;
}
rxHave = 0u;
rxWant = UDPS_HEADER_SIZE;
rxHeaderOk = false;
disconnectTick = HighResolutionTimer::Counter();
for (uint32 i = 0u; was && (i < numStreams); i++) {
if (listeners[i] != NULL_PTR(UDPSClientListener *)) {
listeners[i]->OnUDPSDisconnected();
}
}
}
// ---------------------------------------------------------------------------
// Frame reader
// ---------------------------------------------------------------------------
bool TCPSClient::ReceiveStep() {
struct pollfd p;
p.fd = fd;
p.events = POLLIN;
p.revents = 0;
int pr = poll(&p, 1, TCPS_CLIENT_SLICE_MS);
if (pr < 0) {
return (errno == EINTR);
}
if (pr == 0) {
return true;
}
ssize_t n = recv(fd, &rxBuf[rxHave], rxWant - rxHave, MSG_DONTWAIT);
if (n == 0) {
REPORT_ERROR_STATIC(ErrorManagement::Information,
"TCPSClient: server closed the connection.");
return false;
}
if (n < 0) {
if ((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINTR)) {
return true;
}
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPSClient: recv failed: %s.", strerror(errno));
return false;
}
rxHave += static_cast<uint32>(n);
lastDataTicks = HighResolutionTimer::Counter();
if (!rxHeaderOk && (rxHave >= UDPS_HEADER_SIZE)) {
UDPSPacketHeader h;
memcpy(&h, rxBuf, UDPS_HEADER_SIZE);
if ((h.magic != UDPS_MAGIC) ||
(h.payloadBytes > UDPSClient::UDPS_CLIENT_MAX_PACKET_BYTES) ||
(h.totalFragments != 1u) || (h.fragmentIdx >= numStreams)) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPSClient: invalid frame header (magic 0x%x, %u payload bytes); reconnecting.",
h.magic, h.payloadBytes);
protocolErrors++;
return false;
}
rxHeaderOk = true;
rxWant = UDPS_HEADER_SIZE + h.payloadBytes;
}
if (rxHeaderOk && (rxHave == rxWant)) {
const bool ok = Dispatch();
rxHave = 0u;
rxWant = UDPS_HEADER_SIZE;
rxHeaderOk = false;
return ok;
}
return true;
}
bool TCPSClient::Dispatch() {
UDPSPacketHeader h;
memcpy(&h, rxBuf, UDPS_HEADER_SIZE);
const uint8 *payload = &rxBuf[UDPS_HEADER_SIZE];
const uint32 idx = h.fragmentIdx; // validated < numStreams
UDPSClientListener *listener = listeners[idx];
if (listener != NULL_PTR(UDPSClientListener *)) {
if (h.type == UDPS_TYPE_CONFIG) {
listener->OnUDPSConfig(payload, h.payloadBytes);
} else if (h.type == UDPS_TYPE_DATA) {
lastDataGap[idx] = 0u;
if (lastDataCounterValid[idx]) {
const int32 delta = static_cast<int32>(h.counter - lastDataCounter[idx]);
if (delta > 1) {
lastDataGap[idx] = static_cast<uint32>(delta) - 1u;
}
}
lastDataCounter[idx] = h.counter;
lastDataCounterValid[idx] = true;
listener->OnUDPSFragment(h.counter, rxWant, true);
listener->OnUDPSData(payload, h.payloadBytes);
} else {
// Unknown / client-to-server types are ignored (forward compatible).
}
}
return true;
}
} // namespace MARTe
@@ -0,0 +1,163 @@
#ifndef TCPS_CLIENT_H_
#define TCPS_CLIENT_H_
/**
* @file TCPSClient.h
* @brief Auto-reconnecting TCP receiver for the UDPS wire format.
*
* TCPSClient is the consumer-side counterpart of TCPSServer. It connects to a
* TCPSServer, reads UDPS frames (17-byte header + payload) from the byte stream
* and delivers CONFIG / DATA payloads through UDPSClientListener, so any
* listener written for UDPSClient works unchanged.
*
* It runs its own thread (SingleThreadService); every wait inside Execute() is
* bounded by 50 ms so Stop() is prompt. A partial frame survives across
* iterations. Bad magic, an oversize length, or a fragmented frame means the
* stream cannot be trusted any more: the connection is dropped and re-opened.
*
* There is no CONNECT / ACK / keepalive traffic: the TCP connection is the
* session and the server sends CONFIG on accept.
*/
#include "EmbeddedServiceMethodBinderI.h"
#include "FastPollingMutexSem.h"
#include "ExecutionInfo.h"
#include "SingleThreadService.h"
#include "StreamString.h"
#include "StructuredDataI.h"
#include "UDPSClient.h"
#include "UDPSProtocol.h"
#include "UDPSTransportI.h"
namespace MARTe {
class TCPSClient;
/**
* One stream of a (possibly multiplexed) TCPSClient connection, seen as an
* independent UDPSClientI. Obtained from TCPSClient::GetStream(). Start()/Stop()
* are reference counted so the shared connection runs while any stream wants it.
*/
class TCPSClientStream : public UDPSClientI {
public:
TCPSClientStream(TCPSClient &owner, uint32 index);
virtual ~TCPSClientStream();
/** The connection is configured through its TCPSClient; always succeeds. */
virtual bool Initialise(StructuredDataI &data);
virtual void SetListener(UDPSClientListener *newListener);
virtual bool Start();
virtual bool Stop();
virtual uint32 GetLastDataGap() const;
private:
TCPSClient &owner;
uint32 index;
bool started;
};
class TCPSClient : public UDPSClientI, public EmbeddedServiceMethodBinderI {
public:
/** Most streams one connection can multiplex. */
static const uint32 TCPS_CLIENT_MAX_STREAMS = UDPS_TCP_MAX_STREAMS;
/** Default delay between reconnect attempts (seconds). */
static const uint32 TCPS_CLIENT_DEFAULT_RECONNECT_DELAY_S = 2u;
TCPSClient();
virtual ~TCPSClient();
/**
* Keys:
* - ServerAddr (char*) IPv4 address or host name. Default 127.0.0.1.
* - Port (uint32) Server TCP port. Required.
* - StreamName (char*) Optional. When set, a SUBSCRIBE frame carrying
* this name is sent right after every connect, to
* select one stream of a TCPStreamService. A plain
* TCPSServer ignores (discards) it. A comma
* separated list ("a,b,c") multiplexes several
* streams over this one connection; stream i of
* the list is reached through GetStream(i).
* - SilenceTimeout (float32) Seconds without any received byte before the
* connection is considered dead. Default 0
* (disabled: TCP reports a dead peer itself).
* - ReconnectDelay (float32) Seconds between connection attempts. Default 2.
* - CPUMask (uint32) Receive thread affinity. Default 0xFFFFFFFF.
* - StackSize (uint32) Receive thread stack. Default 65536.
*/
virtual bool Initialise(StructuredDataI &data);
virtual void SetListener(UDPSClientListener *newListener);
/** Listener of stream @p index (0 = SetListener()). Call before Start(). */
void SetStreamListener(uint32 index, UDPSClientListener *newListener);
/** @return number of streams subscribed to (1 unless StreamName is a list). */
uint32 GetNumStreams() const;
/**
* @return a UDPSClientI for stream @p index, owned by this client (NULL if out of
* range). Valid after Initialise().
*/
UDPSClientI *GetStream(uint32 index);
/** Counter gap of the DATA frame of stream @p index being delivered. */
uint32 GetStreamDataGap(uint32 index) const;
/** Reference-counted Start()/Stop() used by the TCPSClientStream facades. */
bool AcquireStart();
bool ReleaseStop();
virtual bool Start();
virtual bool Stop();
/** Thread entry point; do not call directly. */
virtual ErrorManagement::ErrorType Execute(ExecutionInfo &info);
/** Packets the server dropped for this client just before the DATA frame being delivered. */
virtual uint32 GetLastDataGap() const;
/** @return true while a connection is established. */
bool IsConnected() const;
/** @return connections established since Start(). */
uint32 GetConnectionCount() const;
/** @return connections dropped because of a protocol violation. */
uint32 GetProtocolErrors() const;
private:
bool Connect();
void Disconnect();
/** One bounded receive step. @return false when the connection is lost. */
bool ReceiveStep();
/** Deliver the complete frame sitting in rxBuf. @return false on a protocol error. */
bool Dispatch();
/** Validate StreamName as one name or a comma separated list; sets numStreams. */
bool ParseStreamList();
StreamString serverAddr;
StreamString streamName;
uint32 serverPort;
uint64 silenceTimeoutTicks;
uint64 reconnectDelayTicks;
uint32 cpuMask;
uint32 stackSize;
uint32 numStreams;
UDPSClientListener *listeners[UDPS_TCP_MAX_STREAMS];
TCPSClientStream *facades[UDPS_TCP_MAX_STREAMS];
FastPollingMutexSem refMutex;
uint32 startRefs;
SingleThreadService threadService;
int fd;
volatile bool connected;
volatile bool stopping;
uint64 lastDataTicks;
uint64 disconnectTick;
volatile uint32 connectionCount;
volatile uint32 protocolErrors;
uint8 *rxBuf; ///< header + payload of the frame being received
uint32 rxHave; ///< bytes of the current frame received so far
uint32 rxWant; ///< total bytes the current frame needs (header first)
bool rxHeaderOk; ///< header validated; rxWant covers the payload
uint32 lastDataCounter[UDPS_TCP_MAX_STREAMS]; ///< counter of the last delivered DATA frame
bool lastDataCounterValid[UDPS_TCP_MAX_STREAMS]; ///< false until the first DATA frame of a connection
uint32 lastDataGap[UDPS_TCP_MAX_STREAMS]; ///< frames missing before the one being delivered
};
} // namespace MARTe
#endif // TCPS_CLIENT_H_
@@ -0,0 +1,606 @@
/**
* @file TCPSServer.cpp
* @brief Implementation of TCPSServer — UDPS framing over TCP.
*/
#include "TCPSServer.h"
#include "AdvancedErrorManagement.h"
#include "ErrorType.h"
#include "HighResolutionTimer.h"
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
namespace MARTe {
// Out-of-class definitions: the constants are passed by reference (gtest,
// error-report varargs templates), which odr-uses them.
const uint32 TCPSServer::TCPS_DEFAULT_PORT;
const uint32 TCPSServer::TCPS_DEFAULT_MAX_PAYLOAD;
const uint32 TCPSServer::TCPS_MAX_FRAME_PAYLOAD;
const uint32 TCPSServer::TCPS_DEFAULT_MAX_CLIENTS;
const uint32 TCPSServer::TCPS_MAX_CLIENTS_LIMIT;
const uint32 TCPSServer::TCPS_DEFAULT_QUEUE_DEPTH;
const uint32 TCPSServer::TCPS_QUEUE_DEPTH_LIMIT;
const uint32 TCPSServer::TCPS_DEFAULT_STALL_TIMEOUT_S;
// ---------------------------------------------------------------------------
// Per-client state
// ---------------------------------------------------------------------------
/** One queued frame (header + payload). The buffer is reused across frames. */
struct TCPSServer::Slot {
Slot() : buf(NULL_PTR(uint8 *)), cap(0u), len(0u), isConfig(false) {}
~Slot() {
if (buf != NULL_PTR(uint8 *)) {
delete[] buf;
}
}
uint8 *buf;
uint32 cap;
uint32 len;
bool isConfig;
};
/**
* Queue layout: slots[0..count) are pending in wire order; slots[count..cap)
* are free (their buffers are kept for reuse). When sent > 0, slots[0] is
* partially on the wire and must not be touched.
*
* Capacity: at most queueDepth DATA frames, one CONFIG that is on the wire
* and one CONFIG waiting behind it => queueDepth + 2.
*/
struct TCPSServer::Client {
Client() : fd(-1), slots(NULL_PTR(Slot *)), cap(0u), count(0u), sent(0u),
lastProgress(0u) {}
~Client() {
if (slots != NULL_PTR(Slot *)) {
delete[] slots;
}
if (fd >= 0) {
(void)close(fd);
}
}
int fd;
Slot *slots;
uint32 cap;
uint32 count;
uint32 sent; ///< bytes of slots[0] already written
uint64 lastProgress; ///< HRT ticks of the last byte written / queue-empty->non-empty
};
// ---------------------------------------------------------------------------
// Constructor / Destructor
// ---------------------------------------------------------------------------
TCPSServer::TCPSServer()
: port(TCPS_DEFAULT_PORT), boundPort(0u),
maxPayloadSize(TCPS_DEFAULT_MAX_PAYLOAD),
maxClients(TCPS_DEFAULT_MAX_CLIENTS),
queueDepth(TCPS_DEFAULT_QUEUE_DEPTH),
stallTimeoutS(TCPS_DEFAULT_STALL_TIMEOUT_S), sendBufferSize(0u),
listenFd(-1), started(false), clients(NULL_PTR(Client *)), numClients(0u),
cachedConfig(NULL_PTR(uint8 *)), cachedConfigSize(0u), configCounter(0u),
frameBuf(NULL_PTR(uint8 *)), frameCapacity(0u), frameSize(0u),
stallTicks(0u), totalDrops(0u), loggedDrops(0u), lastDropLogTicks(0u),
stallEvictions(0u) {
}
TCPSServer::~TCPSServer() {
(void)Stop();
}
// ---------------------------------------------------------------------------
// Initialise
// ---------------------------------------------------------------------------
bool TCPSServer::Initialise(StructuredDataI &data) {
bool ok = true;
port = TCPS_DEFAULT_PORT;
(void)data.Read("Port", port);
if (port > 65535u) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServer: Port %u out of range.", port);
ok = false;
}
maxPayloadSize = TCPS_DEFAULT_MAX_PAYLOAD;
(void)data.Read("MaxPayloadSize", maxPayloadSize);
if ((maxPayloadSize == 0u) || (maxPayloadSize > TCPS_MAX_FRAME_PAYLOAD)) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServer: MaxPayloadSize %u must be in 1..%u.",
maxPayloadSize, TCPS_MAX_FRAME_PAYLOAD);
ok = false;
}
maxClients = TCPS_DEFAULT_MAX_CLIENTS;
(void)data.Read("MaxClients", maxClients);
if ((maxClients == 0u) || (maxClients > TCPS_MAX_CLIENTS_LIMIT)) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServer: MaxClients %u must be in 1..%u.",
maxClients, TCPS_MAX_CLIENTS_LIMIT);
ok = false;
}
queueDepth = TCPS_DEFAULT_QUEUE_DEPTH;
(void)data.Read("ClientQueueDepth", queueDepth);
if ((queueDepth == 0u) || (queueDepth > TCPS_QUEUE_DEPTH_LIMIT)) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServer: ClientQueueDepth %u must be in 1..%u.",
queueDepth, TCPS_QUEUE_DEPTH_LIMIT);
ok = false;
}
stallTimeoutS = TCPS_DEFAULT_STALL_TIMEOUT_S;
(void)data.Read("ClientStallTimeout", stallTimeoutS);
stallTicks = static_cast<uint64>(stallTimeoutS) * HighResolutionTimer::Frequency();
sendBufferSize = 0u;
(void)data.Read("SendBufferSize", sendBufferSize);
return ok;
}
// ---------------------------------------------------------------------------
// Start / Stop
// ---------------------------------------------------------------------------
bool TCPSServer::Start() {
if (started) {
return true;
}
int fd = socket(AF_INET, SOCK_STREAM, 0);
bool ok = (fd >= 0);
if (!ok) {
REPORT_ERROR_STATIC(ErrorManagement::FatalError,
"TCPSServer: socket() failed: %s.", strerror(errno));
}
if (ok) {
int one = 1;
(void)setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons(static_cast<uint16>(port));
if (bind(fd, reinterpret_cast<struct sockaddr *>(&addr), sizeof(addr)) != 0) {
REPORT_ERROR_STATIC(ErrorManagement::FatalError,
"TCPSServer: bind(%u) failed: %s.", port, strerror(errno));
ok = false;
}
}
if (ok && (listen(fd, 16) != 0)) {
REPORT_ERROR_STATIC(ErrorManagement::FatalError,
"TCPSServer: listen() failed: %s.", strerror(errno));
ok = false;
}
if (ok) {
int flags = fcntl(fd, F_GETFL, 0);
ok = (flags >= 0) && (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
}
if (ok) {
struct sockaddr_in addr;
socklen_t len = static_cast<socklen_t>(sizeof(addr));
memset(&addr, 0, sizeof(addr));
if (getsockname(fd, reinterpret_cast<struct sockaddr *>(&addr), &len) == 0) {
boundPort = ntohs(addr.sin_port);
} else {
boundPort = static_cast<uint16>(port);
}
}
if (ok) {
clients = new Client[maxClients];
listenFd = fd;
numClients = 0u;
started = true;
} else if (fd >= 0) {
(void)close(fd);
}
return ok;
}
bool TCPSServer::Stop() {
if (clients != NULL_PTR(Client *)) {
delete[] clients; // closes every client socket
clients = NULL_PTR(Client *);
}
numClients = 0u;
if (listenFd >= 0) {
(void)close(listenFd);
listenFd = -1;
}
if (cachedConfig != NULL_PTR(uint8 *)) {
delete[] cachedConfig;
cachedConfig = NULL_PTR(uint8 *);
}
cachedConfigSize = 0u;
if (frameBuf != NULL_PTR(uint8 *)) {
delete[] frameBuf;
frameBuf = NULL_PTR(uint8 *);
}
frameCapacity = 0u;
frameSize = 0u;
started = false;
return true;
}
// ---------------------------------------------------------------------------
// Frame building
// ---------------------------------------------------------------------------
bool TCPSServer::BuildFrame(uint8 type, uint32 counter, const uint8 *payload,
uint32 payloadSize) {
bool ok = (payloadSize <= TCPS_MAX_FRAME_PAYLOAD);
if (ok) {
uint32 need = UDPS_HEADER_SIZE + payloadSize;
if (frameCapacity < need) {
if (frameBuf != NULL_PTR(uint8 *)) {
delete[] frameBuf;
}
frameBuf = new uint8[need];
frameCapacity = need;
}
UDPSBuildHeader(frameBuf, type, counter, 0u, 1u, payloadSize);
if (payloadSize > 0u) {
memcpy(&frameBuf[UDPS_HEADER_SIZE], payload, payloadSize);
}
frameSize = need;
}
return ok;
}
// ---------------------------------------------------------------------------
// Queueing
// ---------------------------------------------------------------------------
bool TCPSServer::Enqueue(Client &c, bool isConfig, const uint8 *frame,
uint32 frameBytes) {
const uint32 firstFree = (c.sent > 0u) ? 1u : 0u; // slots below this are on the wire
if (isConfig) {
// Frames behind the one on the wire were encoded for the old layout.
while (c.count > firstFree) {
c.count--;
if (!c.slots[c.count].isConfig) {
totalDrops++;
}
}
} else {
uint32 dataCount = 0u;
for (uint32 i = 0u; i < c.count; i++) {
if (!c.slots[i].isConfig) {
dataCount++;
}
}
if (dataCount >= queueDepth) {
uint32 victim = c.count;
for (uint32 i = firstFree; (i < c.count) && (victim == c.count); i++) {
if (!c.slots[i].isConfig) {
victim = i;
}
}
if (victim == c.count) {
// Only the frame on the wire is queued: nothing may be discarded.
totalDrops++;
return false;
}
// Remove `victim`, keeping its buffer as the (new) free slot.
Slot tmp = c.slots[victim];
for (uint32 i = victim + 1u; i < c.count; i++) {
c.slots[i - 1u] = c.slots[i];
}
c.slots[c.count - 1u] = tmp;
// The array copies above moved raw pointers; make sure `tmp` going
// out of scope does not free the buffer.
tmp.buf = NULL_PTR(uint8 *);
c.count--;
totalDrops++;
}
}
if (c.count >= c.cap) {
// Cannot happen with the capacity argument above; refuse defensively.
totalDrops++;
return false;
}
Slot &s = c.slots[c.count];
if (s.cap < frameBytes) {
if (s.buf != NULL_PTR(uint8 *)) {
delete[] s.buf;
}
s.buf = new uint8[frameBytes];
s.cap = frameBytes;
}
memcpy(s.buf, frame, frameBytes);
s.len = frameBytes;
s.isConfig = isConfig;
if (c.count == 0u) {
c.sent = 0u;
c.lastProgress = HighResolutionTimer::Counter();
}
c.count++;
return true;
}
bool TCPSServer::Flush(Client &c) {
bool alive = true;
while (alive && (c.count > 0u)) {
Slot &s = c.slots[0];
ssize_t n = send(c.fd, &s.buf[c.sent], s.len - c.sent,
MSG_NOSIGNAL | MSG_DONTWAIT);
if (n > 0) {
c.sent += static_cast<uint32>(n);
c.lastProgress = HighResolutionTimer::Counter();
if (c.sent >= s.len) {
// Rotate the finished slot to the free area, keep its buffer.
Slot tmp = c.slots[0];
for (uint32 i = 1u; i < c.count; i++) {
c.slots[i - 1u] = c.slots[i];
}
c.slots[c.count - 1u] = tmp;
tmp.buf = NULL_PTR(uint8 *);
c.count--;
c.sent = 0u;
}
} else if ((n < 0) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) {
break;
} else if ((n < 0) && (errno == EINTR)) {
continue;
} else {
alive = false;
}
}
return alive;
}
/** Detect a peer that closed (or sent garbage: clients never talk to us). */
bool TCPSServer::PeerAlive(Client &c) {
uint8 scratch[64];
bool alive = true;
for (;;) {
ssize_t n = recv(c.fd, scratch, sizeof(scratch), MSG_DONTWAIT);
if (n > 0) {
continue; // discard
}
if (n == 0) {
alive = false;
} else if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
alive = true;
} else if (errno == EINTR) {
continue;
} else {
alive = false;
}
break;
}
return alive;
}
void TCPSServer::Evict(Client &c) {
if (c.fd >= 0) {
(void)close(c.fd);
c.fd = -1;
}
// Slots and their buffers are freed here: the slot may stay idle a long time.
if (c.slots != NULL_PTR(Slot *)) {
delete[] c.slots;
c.slots = NULL_PTR(Slot *);
}
c.cap = 0u;
c.count = 0u;
c.sent = 0u;
if (numClients > 0u) {
numClients--;
}
}
// ---------------------------------------------------------------------------
// Public operations
// ---------------------------------------------------------------------------
void TCPSServer::AcceptPending() {
for (;;) {
int fd = accept(listenFd, NULL_PTR(struct sockaddr *), NULL_PTR(socklen_t *));
if (fd < 0) {
break; // EAGAIN, or a transient error: retry next call
}
Client *slot = NULL_PTR(Client *);
for (uint32 i = 0u; (i < maxClients) && (slot == NULL_PTR(Client *)); i++) {
if (clients[i].fd < 0) {
slot = &clients[i];
}
}
if (slot == NULL_PTR(Client *)) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPSServer: MaxClients (%u) reached; connection refused.",
maxClients);
(void)close(fd);
continue;
}
int flags = fcntl(fd, F_GETFL, 0);
if ((flags < 0) || (fcntl(fd, F_SETFL, flags | O_NONBLOCK) != 0)) {
(void)close(fd);
continue;
}
int one = 1;
(void)setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one));
if (sendBufferSize > 0u) {
int sz = static_cast<int>(sendBufferSize);
(void)setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sz, sizeof(sz));
}
slot->fd = fd;
slot->cap = queueDepth + 2u;
slot->slots = new Slot[slot->cap];
slot->count = 0u;
slot->sent = 0u;
slot->lastProgress = HighResolutionTimer::Counter();
numClients++;
// CONFIG first, so a client always decodes DATA against a CONFIG.
if (cachedConfig != NULL_PTR(uint8 *)) {
if (BuildFrame(UDPS_TYPE_CONFIG, configCounter, cachedConfig, cachedConfigSize)) {
(void)Enqueue(*slot, true, frameBuf, frameSize);
if (!Flush(*slot)) {
Evict(*slot);
}
}
}
}
}
void TCPSServer::ServiceClients() {
if (!started) {
return;
}
AcceptPending();
for (uint32 i = 0u; i < maxClients; i++) {
Client &c = clients[i];
if (c.fd < 0) {
continue;
}
if (!PeerAlive(c) || !Flush(c)) {
Evict(c);
continue;
}
// Read the clock after Flush(): it stamps lastProgress itself.
const uint64 now = HighResolutionTimer::Counter();
if ((stallTicks > 0u) && (c.count > 0u) && (now > c.lastProgress) &&
((now - c.lastProgress) > stallTicks)) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPSServer: client stalled for more than %u s; disconnecting.",
stallTimeoutS);
stallEvictions++;
Evict(c);
}
}
ReportDrops();
}
bool TCPSServer::CacheConfig(const uint8 *payload, uint32 payloadSize) {
if (cachedConfig != NULL_PTR(uint8 *)) {
delete[] cachedConfig;
cachedConfig = NULL_PTR(uint8 *);
cachedConfigSize = 0u;
}
if (payloadSize > 0u) {
cachedConfig = new uint8[payloadSize];
memcpy(cachedConfig, payload, payloadSize);
cachedConfigSize = payloadSize;
}
return true;
}
bool TCPSServer::SendConfig(const uint8 *payload, uint32 payloadSize) {
if (!started) {
return false;
}
if (payloadSize > TCPS_MAX_FRAME_PAYLOAD) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServer: CONFIG of %u bytes exceeds the frame limit.",
payloadSize);
return false;
}
(void)CacheConfig(payload, payloadSize);
configCounter++;
if ((numClients == 0u) || !BuildFrame(UDPS_TYPE_CONFIG, configCounter, payload, payloadSize)) {
return true;
}
for (uint32 i = 0u; i < maxClients; i++) {
Client &c = clients[i];
if (c.fd < 0) {
continue;
}
(void)Enqueue(c, true, frameBuf, frameSize);
if (!Flush(c)) {
Evict(c);
}
}
return true;
}
bool TCPSServer::SendData(uint32 counter, const uint8 *payload, uint32 payloadSize) {
if (!started) {
return false;
}
if (numClients == 0u) {
return true;
}
if (!BuildFrame(UDPS_TYPE_DATA, counter, payload, payloadSize)) {
REPORT_ERROR_STATIC(ErrorManagement::ParametersError,
"TCPSServer: DATA of %u bytes exceeds the frame limit.",
payloadSize);
return false;
}
for (uint32 i = 0u; i < maxClients; i++) {
Client &c = clients[i];
if (c.fd < 0) {
continue;
}
(void)Enqueue(c, false, frameBuf, frameSize);
if (!Flush(c)) {
Evict(c);
}
}
return true;
}
/** Report queue drops at most once per second. */
void TCPSServer::ReportDrops() {
if (totalDrops != loggedDrops) {
const uint64 now = HighResolutionTimer::Counter();
if ((now - lastDropLogTicks) >= HighResolutionTimer::Frequency()) {
REPORT_ERROR_STATIC(ErrorManagement::Warning,
"TCPSServer: %u DATA frame(s) dropped for slow client(s) (total %u).",
static_cast<uint32>(totalDrops - loggedDrops),
static_cast<uint32>(totalDrops));
loggedDrops = totalDrops;
lastDropLogTicks = now;
}
}
}
bool TCPSServer::HasClients() const {
return numClients > 0u;
}
bool TCPSServer::IsMulticast() const {
return false;
}
uint16 TCPSServer::GetPort() const {
return started ? boundPort : static_cast<uint16>(port);
}
uint32 TCPSServer::GetClientCount() const {
return numClients;
}
uint64 TCPSServer::GetClientDrops() const {
return totalDrops;
}
uint32 TCPSServer::GetStallEvictions() const {
return stallEvictions;
}
uint32 TCPSServer::GetMaxPayloadSize() const {
return maxPayloadSize;
}
} // namespace MARTe
@@ -0,0 +1,160 @@
#ifndef TCPS_SERVER_H_
#define TCPS_SERVER_H_
/**
* @file TCPSServer.h
* @brief TCP transport for the UDPS wire format (producer side).
*
* TCPSServer carries the normal UDPS framing (17-byte header + CONFIG / DATA
* payload, totalFragments always 1) over TCP byte streams. It implements
* UDPSServerI so UDPStreamer can publish through it unchanged.
*
* Threading model: NOT thread-safe, exactly like UDPSServer. Every call must
* come from the owner's sender thread. There is no thread per client: sockets
* are non-blocking and everything is driven from ServiceClients() / SendData().
*
* Slow consumers: every client owns a bounded queue of ClientQueueDepth DATA
* frames. When it is full the oldest queued DATA frame that is not already
* (partially) on the wire is discarded and counted; other clients and the
* producer are never affected. A client that makes no progress for
* ClientStallTimeout seconds with data queued is disconnected.
*
* Ordering: a client always sees CONFIG before any DATA. A CONFIG is never
* dropped. When a new CONFIG is published, the frames queued behind the one
* currently on the wire are stale (encoded for the old layout) and are
* discarded, so DATA is never decoded against the wrong CONFIG.
*/
#include "StructuredDataI.h"
#include "UDPSProtocol.h"
#include "UDPSTransportI.h"
namespace MARTe {
class TCPSServer : public UDPSServerI {
public:
/** Default TCP listen port. */
static const uint32 TCPS_DEFAULT_PORT = 44500u;
/** Default maximum payload bytes per frame. */
static const uint32 TCPS_DEFAULT_MAX_PAYLOAD = 60000u;
/** Hard ceiling on a frame payload (matches UDPSClient's packet limit). */
static const uint32 TCPS_MAX_FRAME_PAYLOAD = 1048576u;
/** Default simultaneous clients. */
static const uint32 TCPS_DEFAULT_MAX_CLIENTS = 16u;
/** Upper bound accepted for MaxClients. */
static const uint32 TCPS_MAX_CLIENTS_LIMIT = 1024u;
/** Default DATA frames queued per client. */
static const uint32 TCPS_DEFAULT_QUEUE_DEPTH = 8u;
/** Upper bound accepted for ClientQueueDepth. */
static const uint32 TCPS_QUEUE_DEPTH_LIMIT = 4096u;
/** Default stall timeout (seconds); 0 disables. */
static const uint32 TCPS_DEFAULT_STALL_TIMEOUT_S = 5u;
TCPSServer();
virtual ~TCPSServer();
/**
* @brief Read configuration.
*
* Keys (all optional):
* - Port (uint32) TCP listen port, default 44500. 0 picks an
* ephemeral port (see GetPort() after Start()).
* - MaxPayloadSize (uint32) 1..1 MiB, default 60000. Sizes Accumulate
* batches in the owner; frames larger than 1 MiB are
* refused by SendData().
* - MaxClients (uint32) 1..1024, default 16. Extra connections
* are accepted and closed immediately.
* - ClientQueueDepth (uint32) 1..4096, default 8.
* - ClientStallTimeout (uint32) Seconds, default 5; 0 disables.
* - SendBufferSize (uint32) SO_SNDBUF for client sockets; 0 (default)
* keeps the OS default.
*/
virtual bool Initialise(StructuredDataI &data);
/** Open the listening socket (idempotent). */
virtual bool Start();
/** Close every socket and free all buffers (idempotent). */
virtual bool Stop();
/**
* Accept new clients, drop closed ones, flush queues, evict stalled
* clients. Never blocks.
*/
virtual void ServiceClients();
/**
* Cache the CONFIG and queue it on every connected client. New clients
* receive the cached CONFIG on accept.
*/
virtual bool SendConfig(const uint8 *payload, uint32 payloadSize);
/**
* Queue a DATA frame on every connected client and try to flush.
* @return false only if the frame is larger than TCPS_MAX_FRAME_PAYLOAD.
*/
virtual bool SendData(uint32 counter, const uint8 *payload, uint32 payloadSize);
virtual bool HasClients() const;
virtual bool IsMulticast() const;
/** @return the bound port once started, otherwise the configured port. */
virtual uint16 GetPort() const;
/** @return number of connected clients. */
uint32 GetClientCount() const;
/** @return DATA frames discarded (all clients, all time) because a client queue was full. */
uint64 GetClientDrops() const;
/** @return clients disconnected by the stall timeout (all time). */
uint32 GetStallEvictions() const;
uint32 GetMaxPayloadSize() const;
private:
struct Slot;
struct Client;
bool CacheConfig(const uint8 *payload, uint32 payloadSize);
void AcceptPending();
bool Enqueue(Client &c, bool isConfig, const uint8 *frame, uint32 frameSize);
bool Flush(Client &c);
bool PeerAlive(Client &c);
void Evict(Client &c);
bool BuildFrame(uint8 type, uint32 counter, const uint8 *payload, uint32 payloadSize);
void ReportDrops();
uint32 port;
uint16 boundPort;
uint32 maxPayloadSize;
uint32 maxClients;
uint32 queueDepth;
uint32 stallTimeoutS;
uint32 sendBufferSize;
int listenFd;
bool started;
Client *clients;
uint32 numClients;
uint8 *cachedConfig;
uint32 cachedConfigSize;
uint32 configCounter;
uint8 *frameBuf; ///< scratch: header + payload built once per call
uint32 frameCapacity;
uint32 frameSize;
uint64 stallTicks;
uint64 totalDrops;
uint64 loggedDrops;
uint64 lastDropLogTicks;
uint32 stallEvictions;
};
} // namespace MARTe
#endif // TCPS_SERVER_H_
@@ -27,6 +27,7 @@
#include "StreamString.h"
#include "StructuredDataI.h"
#include "UDPSProtocol.h"
#include "UDPSTransportI.h"
namespace MARTe {
@@ -72,7 +73,7 @@ public:
/**
* @brief UDPS receiver client with auto-reconnect and fragment reassembly.
*/
class UDPSClient : public EmbeddedServiceMethodBinderI {
class UDPSClient : public UDPSClientI, public EmbeddedServiceMethodBinderI {
public:
/** Maximum number of concurrent in-flight reassembly slots. */
@@ -23,6 +23,7 @@
#include "StreamString.h"
#include "StructuredDataI.h"
#include "UDPSProtocol.h"
#include "UDPSTransportI.h"
namespace MARTe {
@@ -43,7 +44,7 @@ namespace MARTe {
* server.Stop(); // in StopCurrentStateExecution()
* @endcode
*/
class UDPSServer {
class UDPSServer : public UDPSServerI {
public:
/** Maximum number of simultaneous unicast clients. */
@@ -0,0 +1,71 @@
#ifndef UDPS_TRANSPORT_I_H_
#define UDPS_TRANSPORT_I_H_
/**
* @file UDPSTransportI.h
* @brief Abstract transport seams used by the UDPStreamer / UDPStreamerClient
* DataSources.
*
* The DataSources only ever touch their transport through these few calls, so
* a different transport (TCP) can be plugged in without duplicating the
* serialisation, quantisation, publishing and decode logic.
*/
#include "CompilerTypes.h"
#include "StructuredDataI.h"
namespace MARTe {
class UDPSClientListener;
/**
* @brief Producer-side transport. NOT thread-safe: every call must come from
* the owner's sender thread.
*/
class UDPSServerI {
public:
virtual ~UDPSServerI() {}
/** Read the transport configuration. */
virtual bool Initialise(StructuredDataI &data) = 0;
/** Open sockets and start accepting clients (idempotent). */
virtual bool Start() = 0;
/** Close everything (idempotent). */
virtual bool Stop() = 0;
/** Non-blocking housekeeping: accept/evict clients, drain queues. */
virtual void ServiceClients() = 0;
/** Publish (and cache) a CONFIG payload. */
virtual bool SendConfig(const uint8 *payload, uint32 payloadSize) = 0;
/** Publish a DATA payload. */
virtual bool SendData(uint32 counter, const uint8 *payload, uint32 payloadSize) = 0;
/** @return true when at least one client is attached. */
virtual bool HasClients() const = 0;
/** @return true when the transport uses multicast. */
virtual bool IsMulticast() const = 0;
/** @return the (bound) port. */
virtual uint16 GetPort() const = 0;
};
/**
* @brief Consumer-side transport. Delivers through UDPSClientListener.
*/
class UDPSClientI {
public:
virtual ~UDPSClientI() {}
virtual bool Initialise(StructuredDataI &data) = 0;
/** Must be called before Start(). */
virtual void SetListener(UDPSClientListener *listener) = 0;
virtual bool Start() = 0;
virtual bool Stop() = 0;
/**
* @return Packets missing between the previous DATA packet and the one
* being delivered (valid inside OnUDPSData). 0 when the transport does
* not track it.
*/
virtual uint32 GetLastDataGap() const { return 0u; }
};
} // namespace MARTe
#endif // UDPS_TRANSPORT_I_H_
@@ -1,3 +1,159 @@
../../../Build/x86-linux/Applications/StreamHub/AccumDtGTest.o: AccumDtGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
../../../Source/Applications/StreamHub/UDPSourceSession.h \
../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../Common/UDP/UDPSProtocol.h \
../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
../../../Source/Applications/StreamHub/SignalRingBuffer.h \
../../../Source/Applications/StreamHub/UDPSourceStats.h \
../../../Source/Applications/StreamHub/TriggerEngine.h \
../../../Source/Applications/StreamHub/BinaryRecorder.h
../../../Build/x86-linux/Applications/StreamHub/BinaryRecorderGTest.o: BinaryRecorderGTest.cpp \
../../../Source/Applications/StreamHub/BinaryRecorder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
@@ -157,6 +313,162 @@
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h
../../../Build/x86-linux/Applications/StreamHub/ConfigHrtFreqGTest.o: ConfigHrtFreqGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
../../../Source/Applications/StreamHub/UDPSourceSession.h \
../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../Common/UDP/UDPSProtocol.h \
../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
../../../Source/Applications/StreamHub/SignalRingBuffer.h \
../../../Source/Applications/StreamHub/UDPSourceStats.h \
../../../Source/Applications/StreamHub/TriggerEngine.h \
../../../Source/Applications/StreamHub/BinaryRecorder.h
../../../Build/x86-linux/Applications/StreamHub/LTTBGTest.o: LTTBGTest.cpp ../../../Source/Applications/StreamHub/LTTB.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
@@ -1,3 +1,159 @@
AccumDtGTest.o: AccumDtGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
../../../Source/Applications/StreamHub/UDPSourceSession.h \
../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../Common/UDP/UDPSProtocol.h \
../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
../../../Source/Applications/StreamHub/SignalRingBuffer.h \
../../../Source/Applications/StreamHub/UDPSourceStats.h \
../../../Source/Applications/StreamHub/TriggerEngine.h \
../../../Source/Applications/StreamHub/BinaryRecorder.h
BinaryRecorderGTest.o: BinaryRecorderGTest.cpp \
../../../Source/Applications/StreamHub/BinaryRecorder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
@@ -157,6 +313,162 @@ BoundsCheckTest.o: BoundsCheckTest.cpp \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h
ConfigHrtFreqGTest.o: ConfigHrtFreqGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
../../../Source/Applications/StreamHub/UDPSourceSession.h \
../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../Common/UDP/UDPSProtocol.h \
../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
../../../Source/Applications/StreamHub/SignalRingBuffer.h \
../../../Source/Applications/StreamHub/UDPSourceStats.h \
../../../Source/Applications/StreamHub/TriggerEngine.h \
../../../Source/Applications/StreamHub/BinaryRecorder.h
LTTBGTest.o: LTTBGTest.cpp ../../../Source/Applications/StreamHub/LTTB.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
@@ -174,6 +174,7 @@
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplicationConfigurationBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/RegisteredMethodsMessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/StandardParser.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationParserI.h \
@@ -190,10 +191,15 @@
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticStack.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/VariableInformation.h \
../../../../Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSServer.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../../../Common/UDP/UDPSProtocol.h UDPStreamerTest.h
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
../../../../Common/UDP/UDPSProtocol.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../../Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSServer.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
UDPStreamerTest.h
@@ -174,6 +174,7 @@ UDPStreamerTest.o: UDPStreamerTest.cpp \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplicationConfigurationBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/RegisteredMethodsMessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/StandardParser.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationParserI.h \
@@ -190,10 +191,15 @@ UDPStreamerTest.o: UDPStreamerTest.cpp \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticStack.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/VariableInformation.h \
../../../../Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSServer.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../../../Common/UDP/UDPSProtocol.h UDPStreamerTest.h
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
../../../../Common/UDP/UDPSProtocol.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../../../Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSServer.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
UDPStreamerTest.h
@@ -97,7 +97,7 @@
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
@@ -107,6 +107,7 @@
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
@@ -182,7 +183,6 @@
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
@@ -194,4 +194,5 @@
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
UDPStreamerClientTest.h
@@ -97,7 +97,7 @@ UDPStreamerClientTest.o: UDPStreamerClientTest.cpp \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
@@ -107,6 +107,7 @@ UDPStreamerClientTest.o: UDPStreamerClientTest.cpp \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
@@ -182,7 +183,6 @@ UDPStreamerClientTest.o: UDPStreamerClientTest.cpp \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
@@ -194,4 +194,5 @@ UDPStreamerClientTest.o: UDPStreamerClientTest.cpp \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
UDPStreamerClientTest.h
@@ -0,0 +1,28 @@
/**
* E2E Test — FileReader → TCPStreamer (in-process TCPStreamService) → TCPStreamerClient → FileWriter
* The service is a root object; the streamer joins it with Service/StreamName and the
* client subscribes to that stream by name.
* Signal names MUST match the binary file header (Signal_100, Signal_1K, Signal_5K).
*/
+Svc = { Class = TCPStreamService Port = 44622 Workers = 2 }
$E2ETCPServiceTest = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+TimerGAM = { Class = IOGAM InputSignals = { Counter = { DataSource = ReaderTimer Type = uint32 } Time = { Frequency = 10 DataSource = ReaderTimer Type = uint32 } } OutputSignals = { Counter = { DataSource = DDB Type = uint32 } Time = { DataSource = DDB Type = uint32 } } }
+ReaderGAM = { Class = IOGAM InputSignals = { Signal_100 = { DataSource = FileReaderDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { DataSource = FileReaderDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { DataSource = FileReaderDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } OutputSignals = { Signal_100 = { DataSource = Streamer Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { DataSource = Streamer Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { DataSource = Streamer Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
+ClientGAM = { Class = IOGAM InputSignals = { Signal_100 = { DataSource = ClientDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { DataSource = ClientDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { DataSource = ClientDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } OutputSignals = { Signal_100 = { DataSource = FileWriterDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { DataSource = FileWriterDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { DataSource = FileWriterDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
}
+Data = {
Class = ReferenceContainer DefaultDataSource = DDB
+DDB = { Class = GAMDataSource }
+ReaderTimer = { Class = LinuxTimer SleepNature = "Default" Signals = { Counter = { Type = uint32 } Time = { Type = uint32 } } }
+FileReaderDS = { Class = FileReader Filename = "/tmp/udpstreamer_test_input.bin" Interpolate = "no" FileFormat = "binary" }
+Streamer = { Class = TCPStreamer Service = "Svc" StreamName = "direct" MaxPayloadSize = 65507 PublishingMode = "Strict" Signals = { Signal_100 = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
+ClientDS = { Class = TCPStreamerClient ServerAddress = "127.0.0.1" Port = 44622 StreamName = "direct" MaxPayloadSize = 65507 Signals = { Signal_100 = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
+FileWriterDS = { Class = FileWriter NumberOfBuffers = 10 CPUMask = 0x10 StackSize = 10000000 Filename = "/tmp/udpstreamer_test_output_tcpsvc.bin" Overwrite = "yes" StoreOnTrigger = 0 FileFormat = "binary" Signals = { Signal_100 = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
+Timings = { Class = TimingDataSource }
}
+States = { Class = ReferenceContainer +Running = { Class = RealTimeState +Threads = { Class = ReferenceContainer +ReaderThread = { Class = RealTimeThread CPUs = 0x1 Functions = {TimerGAM ReaderGAM} } +ClientThread = { Class = RealTimeThread CPUs = 0x2 Functions = {ClientGAM} } } } }
+Scheduler = { Class = GAMScheduler TimingDataSource = Timings }
}
+25
View File
@@ -0,0 +1,25 @@
/**
* E2E Test — FileReader → TCPStreamer → TCPStreamerClient → FileWriter
* Signal names MUST match the binary file header (Signal_100, Signal_1K, Signal_5K).
*/
$E2ETCPTest = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+TimerGAM = { Class = IOGAM InputSignals = { Counter = { DataSource = ReaderTimer Type = uint32 } Time = { Frequency = 10 DataSource = ReaderTimer Type = uint32 } } OutputSignals = { Counter = { DataSource = DDB Type = uint32 } Time = { DataSource = DDB Type = uint32 } } }
+ReaderGAM = { Class = IOGAM InputSignals = { Signal_100 = { DataSource = FileReaderDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { DataSource = FileReaderDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { DataSource = FileReaderDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } OutputSignals = { Signal_100 = { DataSource = Streamer Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { DataSource = Streamer Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { DataSource = Streamer Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
+ClientGAM = { Class = IOGAM InputSignals = { Signal_100 = { DataSource = ClientDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { DataSource = ClientDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { DataSource = ClientDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } OutputSignals = { Signal_100 = { DataSource = FileWriterDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { DataSource = FileWriterDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { DataSource = FileWriterDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
}
+Data = {
Class = ReferenceContainer DefaultDataSource = DDB
+DDB = { Class = GAMDataSource }
+ReaderTimer = { Class = LinuxTimer SleepNature = "Default" Signals = { Counter = { Type = uint32 } Time = { Type = uint32 } } }
+FileReaderDS = { Class = FileReader Filename = "/tmp/udpstreamer_test_input.bin" Interpolate = "no" FileFormat = "binary" }
+Streamer = { Class = TCPStreamer Port = 44620 MaxPayloadSize = 65507 PublishingMode = "Strict" Signals = { Signal_100 = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
+ClientDS = { Class = TCPStreamerClient ServerAddress = "127.0.0.1" Port = 44620 MaxPayloadSize = 65507 Signals = { Signal_100 = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
+FileWriterDS = { Class = FileWriter NumberOfBuffers = 10 CPUMask = 0x10 StackSize = 10000000 Filename = "/tmp/udpstreamer_test_output_tcp.bin" Overwrite = "yes" StoreOnTrigger = 0 FileFormat = "binary" Signals = { Signal_100 = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 } Signal_1K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 } Signal_5K = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 } } }
+Timings = { Class = TimingDataSource }
}
+States = { Class = ReferenceContainer +Running = { Class = RealTimeState +Threads = { Class = ReferenceContainer +ReaderThread = { Class = RealTimeThread CPUs = 0x1 Functions = {TimerGAM ReaderGAM} } +ClientThread = { Class = RealTimeThread CPUs = 0x2 Functions = {ClientGAM} } } } }
+Scheduler = { Class = GAMScheduler TimingDataSource = Timings }
}
+49 -7
View File
@@ -103,10 +103,23 @@ def _streamer_sig(sig):
return f"{sig['name']} = {{ {' '.join(parts)} }}"
SERVICE_NAME = "Svc"
def _service_port(scenario):
"""Port of the shared TCPStreamService (first source's port)."""
return scenario["sources"][0]["udp_port"]
def _streamer_block(src, scenario):
s = src["signals"]
parts = [f"Port = {src['udp_port']}",
f"MaxPayloadSize = {scenario['max_payload']}",
net = scenario["network"]
if net == "tcp_service":
# Port, MaxClients, ... belong to the service; the streamer only joins it.
parts = [f'Service = "{SERVICE_NAME}"', f'StreamName = "{S.stream_name(scenario, src)}"']
else:
parts = [f"Port = {src['udp_port']}"]
parts += [f"MaxPayloadSize = {scenario['max_payload']}",
f'PublishingMode = "{scenario["publishing"]}"']
if scenario["publishing"] == "Accumulate":
parts.append(f"MinRefreshRate = {scenario['min_refresh_hz']}")
@@ -118,7 +131,8 @@ def _streamer_block(src, scenario):
iface = src.get("interface") or _mcast_interface_ip(src["multicast_group"])
parts.append(f'Interface = "{iface}"')
sigs = " ".join(_streamer_sig(sig) for sig in s)
return (f" +Streamer_{src['id']} = {{ Class = UDPStreamer "
cls = "UDPStreamer" if net in ("unicast", "multicast") else "TCPStreamer"
return (f" +Streamer_{src['id']} = {{ Class = {cls} "
f"{' '.join(parts)} Signals = {{ {sigs} }} }}")
@@ -202,7 +216,19 @@ def write_marte_cfg(scenario, path, input_bin, tap_bin=None):
data_block = "\n".join(datas)
thread_list = " ".join(thread_funcs)
cfg = f"""$ChainE2E = {{
service_block = ""
if scenario["network"] == "tcp_service":
service_block = (f"+{SERVICE_NAME} = {{ Class = TCPStreamService "
f"Port = {_service_port(scenario)} Workers = 2 "
f"MaxClients = 16 MaxStreams = 16 }}\n")
hub = scenario.get("hub")
if hub and hub["mode"] == "join":
names = ",".join(S.stream_name(scenario, x) for x in scenario["sources"])
service_block += (f"+Join = {{ Class = TCPStreamJoin Service = \"{SERVICE_NAME}\" "
f"StreamName = \"{hub['name']}\" Sources = \"{names}\" "
f"Master = \"{hub['master']}\" }}\n")
cfg = f"""{service_block}$ChainE2E = {{
Class = RealTimeApplication
+Functions = {{
Class = ReferenceContainer
@@ -227,10 +253,26 @@ def write_marte_cfg(scenario, path, input_bin, tap_bin=None):
def write_hub_cfg(scenario, path):
os.makedirs(os.path.dirname(os.path.abspath(path)), exist_ok=True)
src_blocks = []
for src in scenario["sources"]:
hub = scenario.get("hub")
if hub and hub["mode"] == "mux":
names = ",".join(S.stream_name(scenario, x) for x in scenario["sources"])
src_blocks.append(
f' {hub["node"]} = {{ Label = "chain" Addr = "127.0.0.1" '
f'Port = {_service_port(scenario)} Transport = "tcp" StreamName = "{names}" }}')
elif hub and hub["mode"] == "join":
src_blocks.append(
f' {hub["name"]} = {{ Label = "chain {hub["name"]}" Addr = "127.0.0.1" '
f'Port = {_service_port(scenario)} Transport = "tcp" StreamName = "{hub["name"]}" }}')
for src in ([] if hub else scenario["sources"]):
net = scenario["network"]
port = _service_port(scenario) if net == "tcp_service" else src["udp_port"]
parts = [f'Label = "chain {src["id"]}"', 'Addr = "127.0.0.1"',
f"Port = {src['udp_port']}"]
if scenario["network"] == "multicast":
f"Port = {port}"]
if net in ("tcp", "tcp_service"):
parts.append('Transport = "tcp"')
if net == "tcp_service":
parts.append(f'StreamName = "{src["id"]}"')
if net == "multicast":
parts.append(f'MulticastGroup = "{src["multicast_group"]}"')
parts.append(f"DataPort = {src['data_port']}")
src_blocks.append(f" {src['id']} = {{ {' '.join(parts)} }}")
+6
View File
@@ -113,6 +113,12 @@ def build_ground_truth(scenario):
"range_min": sig["range_min"], "range_max": sig["range_max"],
"is_time": sig["is_time"],
}
hub = scenario.get("hub")
if hub and hub.get("mode") == "join":
# The merged stream carries every source signal as "<src>_<signal>".
for key in list(gt):
src_id, sig_name = key.split(":", 1)
gt[f"{hub['name']}:{src_id}_{sig_name}"] = gt[key]
return gt
+15
View File
@@ -59,6 +59,9 @@ COMP="${MARTe2_Components_DIR}/Build/${TARGET}/Components"
export LD_LIBRARY_PATH="\
${BUILD_DIR}/Components/DataSources/UDPStreamer:\
${BUILD_DIR}/Components/DataSources/UDPStreamerClient:\
${BUILD_DIR}/Components/DataSources/TCPStreamer:\
${BUILD_DIR}/Components/DataSources/TCPStreamerClient:\
${BUILD_DIR}/Components/Interfaces/TCPStreamService:\
${BUILD_DIR}/Components/Interfaces/UDPStream:\
${BUILD_DIR}/Components/Interfaces/DebugService:\
${BUILD_DIR}/Components/Interfaces/TCPLogger:\
@@ -68,6 +71,15 @@ ${COMP}/DataSources/FileDataSource:\
${COMP}/GAMs/IOGAM:\
${LD_LIBRARY_PATH:-}"
# MARTe2 resolves a class by dlopen("<Class>.so"), but the FileDataSource library
# bundles FileReader and FileWriter under one name. Provide per-class aliases.
ALIAS_DIR="${WORK}/class_aliases"
mkdir -p "${ALIAS_DIR}"
for cls in FileReader FileWriter; do
ln -sf "${COMP}/DataSources/FileDataSource/FileDataSource.so" "${ALIAS_DIR}/${cls}.so"
done
export LD_LIBRARY_PATH="${ALIAS_DIR}:${LD_LIBRARY_PATH}"
MARTE_APP="${MARTe2_DIR}/Build/${TARGET}/App/MARTeApp.ex"
STREAMHUB_EX="${BUILD_DIR}/StreamHub/StreamHub.ex"
CLIENT="${SCRIPT_DIR}/client/chain-client"
@@ -94,6 +106,9 @@ if [ "${SKIP_BUILD}" -eq 0 ]; then
make -C "${REPO_ROOT}/Source/Components/Interfaces/UDPStream" -f Makefile.gcc TARGET="${TARGET}" 2>&1 | tail -1
make -C "${REPO_ROOT}/Source/Components/DataSources/UDPStreamer" -f Makefile.gcc TARGET="${TARGET}" 2>&1 | tail -1
make -C "${REPO_ROOT}/Source/Components/DataSources/UDPStreamerClient" -f Makefile.gcc TARGET="${TARGET}" 2>&1 | tail -1
make -C "${REPO_ROOT}/Source/Components/Interfaces/TCPStreamService" -f Makefile.gcc TARGET="${TARGET}" 2>&1 | tail -1
make -C "${REPO_ROOT}/Source/Components/DataSources/TCPStreamer" -f Makefile.gcc TARGET="${TARGET}" 2>&1 | tail -1
make -C "${REPO_ROOT}/Source/Components/DataSources/TCPStreamerClient" -f Makefile.gcc TARGET="${TARGET}" 2>&1 | tail -1
make -C "${REPO_ROOT}/Source/Applications/StreamHub" -f Makefile.gcc TARGET="${TARGET}" 2>&1 | tail -1
fi
if [ ! -x "${CLIENT}" ]; then
+147 -6
View File
@@ -15,7 +15,21 @@ Scenario dict schema
{
"id": str # unique slug, also the artifact basename
"desc": str # human-readable one-liner for the report
"network": "unicast" | "multicast"
"network": "unicast" | "multicast" | "tcp" | "tcp_service"
# tcp: one TCPStreamer per source, each listening on
# its own udp_port
# tcp_service: one in-process TCPStreamService (root object)
# on sources[0].udp_port; every source is a
# TCPStreamer joined to it with StreamName=<src id>
"hub": None | {"mode": "mux", "node": str}
| {"mode": "join", "name": str, "master": str}
# tcp_service only. mux: the hub takes every source over ONE
# multiplexed connection (a single comma separated StreamName);
# source ids must be "<node>_<stream>" (the hub names its sessions
# "<node>_<stream>") and the MARTe stream name is "<stream>".
# join: a TCPStreamJoin merges all sources into stream <name>
# (paced by <master>); the hub subscribes to <name> only and sees
# signals "<src>_<signal>" under hub source <name>.
"publishing": "Strict" | "Accumulate" | "Decimate"
"ratio": int | None # Decimate only (>=1)
"min_refresh_hz": float | None # Accumulate only (>0)
@@ -132,6 +146,14 @@ def _sig(name, type, elements=1, time_mode="PacketTime", time_signal=None,
}
def stream_name(scenario, src):
"""MARTe-side TCPStreamService stream name of a source."""
hub = scenario.get("hub")
if hub and hub.get("mode") == "mux":
return src["id"][len(hub["node"]) + 1:]
return src["id"]
def validate_scenario(s):
"""Return a list of validity error strings (empty == valid)."""
errs = []
@@ -152,8 +174,8 @@ def validate_scenario(s):
errs.append(f"unknown scenario kind: {kind}")
return errs
row_dt, num_rows, _producer_hz, loop_hz = geometry(s)
if s.get("network") not in ("unicast", "multicast"):
errs.append("network must be unicast|multicast")
if s.get("network") not in ("unicast", "multicast", "tcp", "tcp_service"):
errs.append("network must be unicast|multicast|tcp|tcp_service")
if s.get("publishing") not in ("Strict", "Accumulate", "Decimate"):
errs.append("publishing invalid")
if s["publishing"] == "Decimate" and not (s.get("ratio") and s["ratio"] >= 1):
@@ -164,11 +186,27 @@ def validate_scenario(s):
if not s.get("sources"):
errs.append("no sources")
max_payload = s.get("max_payload")
if max_payload is not None and max_payload + UDPS_HEADER_SIZE > MAX_UDP_PAYLOAD:
is_udp = s["network"] in ("unicast", "multicast")
if is_udp and max_payload is not None and max_payload + UDPS_HEADER_SIZE > MAX_UDP_PAYLOAD:
errs.append(
f"max_payload {max_payload} + {UDPS_HEADER_SIZE}B header exceeds the "
f"{MAX_UDP_PAYLOAD}B UDP datagram limit (sendto EMSGSIZE); "
f"cap at {MAX_UDP_PAYLOAD - UDPS_HEADER_SIZE}")
hub = s.get("hub")
if hub:
ids = [x["id"] for x in s.get("sources", [])]
if s["network"] != "tcp_service":
errs.append("hub mux/join needs network=tcp_service")
elif hub.get("mode") == "mux":
if not all(i.startswith(hub["node"] + "_") for i in ids):
errs.append(f"mux source ids must start with '{hub['node']}_'")
elif hub.get("mode") == "join":
if hub.get("master") not in ids or hub.get("name") in ids:
errs.append("join master must be a source id and the name must differ from all of them")
if s["publishing"] == "Accumulate":
errs.append("join cannot merge Accumulate sources")
else:
errs.append("hub.mode must be mux|join")
for src in s.get("sources", []):
if s["network"] == "multicast":
if not src.get("multicast_group") or not src.get("data_port"):
@@ -250,7 +288,7 @@ def _src(sid, signals, multicast=False):
def mk(sid, desc, sources, network="unicast", publishing="Strict",
ratio=None, min_refresh_hz=None, max_payload=1400,
oracle="analytic", checks=("live", "zoom"), trig=None,
known_issue=None, row_dt=None, num_rows=None, producer_hz=None):
known_issue=None, row_dt=None, num_rows=None, producer_hz=None, hub=None):
# row_dt / num_rows / producer_hz override the global producer geometry for
# this scenario only (default None == use the suite-wide NUM_ROWS / ROW_DT /
# 1 kHz). They are kept together so the per-cycle wall gap (1/producer_hz),
@@ -264,6 +302,7 @@ def mk(sid, desc, sources, network="unicast", publishing="Strict",
"client_checks": list(checks), "trig_signal": trig,
"known_issue": known_issue,
"row_dt": row_dt, "num_rows": num_rows, "producer_hz": producer_hz,
"hub": hub,
}
@@ -577,9 +616,94 @@ _HIGHRATE = [
checks=("live", "zoom")),
]
# ── TCP transports ────────────────────────────────────────────────────────────
# Same chain, TCPStreamer instead of UDPStreamer. "tcp": one listening socket per
# source. "tcp_service": one TCPStreamService (in-process, root object) serves all
# sources; each is a TCPStreamer joined with Service/StreamName and the hub
# subscribes to it by name. TCP does not fragment (max_payload only sizes
# Accumulate batches), so the UDP datagram cap does not apply.
_TCP = [
mk("s60_tcp_scalar", "TCPStreamer: float32 sine 5 Hz + uint32 counter, all checks",
[_src("src", [_sig("Counter", "uint32", 1, formula="counter"),
_sig("Sine", "float32", 1, formula="sine", freq=5.0, unit="V")])],
network="tcp", checks=("live", "zoom", "window", "trigger"), trig="src:Sine"),
mk("s61_tcp_arr_fullarray", "TCPStreamer: 32-elem float32 FullArray sine 5 Hz",
[_src("src", [
_sig("TimeArr", "uint64", 32, unit="ns", formula="time_ns", is_time=True),
_sig("Wave", "float32", 32, time_mode="FullArray",
time_signal="TimeArr", formula="sine", freq=5.0),
])],
network="tcp", oracle="both"),
mk("s62_tcp_accumulate", "TCPStreamer: Accumulate @100 Hz scalar sine 5 Hz",
[_src("src", [_sig("Sine", "float32", 1, formula="sine", freq=5.0)])],
network="tcp", publishing="Accumulate", min_refresh_hz=100.0),
mk("s63_tcp_decimate_quant", "TCPStreamer: Decimate 2 + 16-elem quant uint16 sine 5 Hz",
[_src("src", [_sig("Wave", "float32", 16, quant="uint16", range_min=-1.0,
range_max=1.0, formula="sine", freq=5.0)])],
network="tcp", publishing="Decimate", ratio=2),
mk("s64_tcp_multisrc", "TCPStreamer: two sources on separate ports",
[_src("a", [_sig("Sine", "float32", 1, formula="sine", freq=5.0)]),
_src("b", [_sig("Cnt", "uint32", 1, formula="counter")])],
network="tcp"),
mk("s65_tcp_highrate",
"TCPStreamer: 4x float32 2000-elem arrays, FirstSample 200 kSps, 100 Hz "
"(~3 MB/s, 32 KB frames)",
[_src("src", [
_sig("Tns", "uint64", 1, unit="ns", formula="time_ns", is_time=True),
] + [
_sig(f"S{i}", "float32", 2000, time_mode="FirstSample",
time_signal="Tns", sampling_rate=2.0e5, formula="ramp")
for i in range(4)
])],
network="tcp", max_payload=40000, row_dt=0.01, num_rows=50, producer_hz=100,
checks=("live", "zoom")),
mk("s66_svc_scalar", "TCPStreamService: one stream, sine 5 Hz + counter, all checks",
[_src("src", [_sig("Counter", "uint32", 1, formula="counter"),
_sig("Sine", "float32", 1, formula="sine", freq=5.0, unit="V")])],
network="tcp_service", checks=("live", "zoom", "window", "trigger"),
trig="src:Sine"),
mk("s67_svc_multisrc",
"TCPStreamService: three streams of one service (int16 ramp / float64 sine / uint8 counter)",
[_src("a", [_sig("Ramp", "int16", 1, formula="ramp")]),
_src("b", [_sig("Sine", "float64", 1, formula="sine", freq=5.0)]),
_src("c", [_sig("Cnt", "uint8", 1, formula="counter")])],
network="tcp_service"),
mk("s68_svc_arr_fullarray", "TCPStreamService: 32-elem float32 FullArray sine 5 Hz",
[_src("src", [
_sig("TimeArr", "uint64", 32, unit="ns", formula="time_ns", is_time=True),
_sig("Wave", "float32", 32, time_mode="FullArray",
time_signal="TimeArr", formula="sine", freq=5.0),
])],
network="tcp_service", oracle="both"),
mk("s69_svc_accumulate", "TCPStreamService: Accumulate @100 Hz, two streams",
[_src("a", [_sig("Sine", "float32", 1, formula="sine", freq=5.0)]),
_src("b", [_sig("Sine", "float32", 1, formula="sine", freq=10.0)])],
network="tcp_service", publishing="Accumulate", min_refresh_hz=100.0),
mk("s70_svc_decimate_quant", "TCPStreamService: Decimate 2 + 16-elem quant uint16 sine 5 Hz",
[_src("src", [_sig("Wave", "float32", 16, quant="uint16", range_min=-1.0,
range_max=1.0, formula="sine", freq=5.0)])],
network="tcp_service", publishing="Decimate", ratio=2),
mk("s71_svc_six_streams",
"TCPStreamService: six concurrent streams share two worker threads",
[_src(f"s{i}", [_sig("Sine", "float32", 1, formula="sine", freq=5.0 * (i + 1))])
for i in range(6)],
network="tcp_service"),
mk("s72_svc_mux",
"TCPStreamService: hub takes three streams over ONE multiplexed connection",
[_src("mux_a", [_sig("Ramp", "int16", 1, formula="ramp")]),
_src("mux_b", [_sig("Sine", "float64", 1, formula="sine", freq=5.0)]),
_src("mux_c", [_sig("Cnt", "uint8", 1, formula="counter")])],
network="tcp_service", hub={"mode": "mux", "node": "mux"}),
mk("s73_svc_join",
"TCPStreamJoin: two streams merged into one (master b), hub subscribes to the merge",
[_src("a", [_sig("Counter", "uint32", 1, formula="counter")]),
_src("b", [_sig("Sine", "float32", 1, formula="sine", freq=5.0, unit="V")])],
network="tcp_service", hub={"mode": "join", "name": "all", "master": "b"}),
]
SCENARIOS = (_STARTERS + _TYPES + _ARRAYS + _TIMEMODES + _QUANT + _PUBLISH +
_PAYLOAD + _MCAST + _MULTISRC + _INTERACT + _TRIGGER + _MISC +
_HIGHRATE)
_HIGHRATE + _TCP)
for _s in SCENARIOS:
_s.setdefault("kind", "chain")
@@ -606,6 +730,23 @@ _DIRECT = [
"client_checks": [],
"known_issue": None,
},
{
"id": "s58_direct_tcp",
"desc": "Direct TCPStreamer->TCPStreamerClient round-trip",
"kind": "direct",
"cfg": "Test/E2E/datasources/E2ETCPTest.cfg",
"client_checks": [],
"known_issue": None,
},
{
"id": "s59_direct_tcp_service",
"desc": "Direct TCPStreamer (in-process TCPStreamService) -> TCPStreamerClient "
"(named-stream subscription) round-trip",
"kind": "direct",
"cfg": "Test/E2E/datasources/E2ETCPServiceTest.cfg",
"client_checks": [],
"known_issue": None,
},
]
_RECORDER = [
+2 -1
View File
@@ -68,7 +68,8 @@ class TestScenarios(unittest.TestCase):
self.assertIn("direct", kinds)
self.assertIn("recorder", kinds)
direct_ids = {s["id"] for s in S.SCENARIOS if s["kind"] == "direct"}
self.assertEqual(direct_ids, {"s52_direct_unicast", "s53_direct_multicast"})
self.assertEqual(direct_ids, {"s52_direct_unicast", "s53_direct_multicast",
"s58_direct_tcp", "s59_direct_tcp_service"})
recorder_ids = {s["id"] for s in S.SCENARIOS if s["kind"] == "recorder"}
self.assertEqual(recorder_ids, {"s54_recorder"})
+5 -1
View File
@@ -44,12 +44,16 @@ INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
INCLUDES += -I$(MARTe2_DIR)/Lib/gtest-1.7.0/include
INCLUDES += -I$(ROOT_DIR)/Common/UDP
INCLUDES += -I$(ROOT_DIR)/Source/Components/DataSources/UDPStreamer
INCLUDES += -I$(ROOT_DIR)/Source/Components/DataSources/UDPStreamerClient
INCLUDES += -I$(ROOT_DIR)/Source/Components/DataSources/TCPStreamer
INCLUDES += -I$(ROOT_DIR)/Source/Components/DataSources/TCPStreamerClient
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/DebugService
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/TCPLogger
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/UDPStream
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/TCPStreamService
INCLUDES += -I$(ROOT_DIR)/Test/Components/DataSources/UDPStreamer
OBJSX = DebugServiceGTest.x UDPSClientGTest.x
OBJSX = DebugServiceGTest.x UDPSClientGTest.x TCPSServerGTest.x TCPSClientGTest.x TCPStreamerGTest.x TCPStreamServiceGTest.x
all: $(BUILD_DIR)/MainGTest$(EXEEXT)
+699
View File
@@ -0,0 +1,699 @@
/**
* @file TCPSClientGTest.cpp
* @brief GTest coverage for TCPSClient (UDPS framing over TCP, consumer side).
*
* Each test runs the real TCPSClient either against the real TCPSServer or
* against a scripted raw-socket "server" that misbehaves on purpose (bad
* magic, oversize length, byte-at-a-time delivery, silence).
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*/
#define DLL_API
#include "gtest/gtest.h"
#include <pthread.h>
#include <unistd.h>
#include "ConfigurationDatabase.h"
#include "Sleep.h"
#include "TCPSClient.h"
#include "TCPSServer.h"
#include "TCPTestUtil.h"
using namespace MARTe;
using namespace tcptest;
namespace {
/** Thread-safe recorder of everything the client delivers. */
class Recorder : public UDPSClientListener {
public:
Recorder() : connects(0u), disconnects(0u) {
pthread_mutex_init(&mu, NULL);
}
~Recorder() {
pthread_mutex_destroy(&mu);
}
virtual void OnUDPSConfig(const uint8 *p, uint32 n) {
pthread_mutex_lock(&mu);
configs.push_back(std::vector<uint8>(p, p + n));
order.push_back('C');
pthread_mutex_unlock(&mu);
}
virtual void OnUDPSData(const uint8 *p, uint32 n) {
pthread_mutex_lock(&mu);
datas.push_back(std::vector<uint8>(p, p + n));
order.push_back('D');
pthread_mutex_unlock(&mu);
}
virtual void OnUDPSFragment(uint32 counter, uint32 nBytes, bool complete) {
pthread_mutex_lock(&mu);
counters.push_back(counter);
pthread_mutex_unlock(&mu);
}
virtual void OnUDPSConnected() {
pthread_mutex_lock(&mu);
connects++;
pthread_mutex_unlock(&mu);
}
virtual void OnUDPSDisconnected() {
pthread_mutex_lock(&mu);
disconnects++;
pthread_mutex_unlock(&mu);
}
uint32 NumConfigs() { return Locked(configs.size()); }
uint32 NumDatas() { return Locked(datas.size()); }
uint32 Connects() { return Locked(connects); }
uint32 Disconnects() { return Locked(disconnects); }
std::vector<uint8> Config(size_t i) {
pthread_mutex_lock(&mu);
std::vector<uint8> v = configs[i];
pthread_mutex_unlock(&mu);
return v;
}
std::vector<uint8> Data(size_t i) {
pthread_mutex_lock(&mu);
std::vector<uint8> v = datas[i];
pthread_mutex_unlock(&mu);
return v;
}
uint32 Counter(size_t i) {
pthread_mutex_lock(&mu);
uint32 v = counters[i];
pthread_mutex_unlock(&mu);
return v;
}
std::string Order() {
pthread_mutex_lock(&mu);
std::string v = order;
pthread_mutex_unlock(&mu);
return v;
}
private:
uint32 Locked(size_t v) {
pthread_mutex_lock(&mu);
uint32 r = static_cast<uint32>(v);
pthread_mutex_unlock(&mu);
return r;
}
pthread_mutex_t mu;
std::vector<std::vector<uint8> > configs;
std::vector<std::vector<uint8> > datas;
std::vector<uint32> counters;
std::string order;
uint32 connects;
uint32 disconnects;
};
bool InitClient(TCPSClient &c, uint16 port, float32 reconnect = 0.1f, float32 silence = 0.0f) {
ConfigurationDatabase cdb;
(void)cdb.Write("ServerAddr", "127.0.0.1");
(void)cdb.Write("Port", static_cast<uint32>(port));
(void)cdb.Write("ReconnectDelay", reconnect);
(void)cdb.Write("SilenceTimeout", silence);
return c.Initialise(cdb);
}
bool InitServer(TCPSServer &s, uint16 port) {
ConfigurationDatabase cdb;
(void)cdb.Write("Port", static_cast<uint32>(port));
return s.Initialise(cdb);
}
/** Pump the server until @p cond is true or timeout. */
#define PUMP_UNTIL(server, cond, timeoutMs, result) \
{ \
const uint64 pumpDeadline = NowMs() + (timeoutMs); \
(result) = false; \
while (NowMs() < pumpDeadline) { \
(server).ServiceClients(); \
if (cond) { \
(result) = true; \
break; \
} \
Sleep::MSec(5u); \
} \
}
#define WAIT_UNTIL(cond, timeoutMs, result) \
{ \
const uint64 waitDeadline = NowMs() + (timeoutMs); \
(result) = false; \
while (NowMs() < waitDeadline) { \
if (cond) { \
(result) = true; \
break; \
} \
Sleep::MSec(5u); \
} \
}
} // namespace
TEST(TCPSClientGTest, TestInitialise_RequiresPort) {
TCPSClient c;
ConfigurationDatabase cdb;
EXPECT_FALSE(c.Initialise(cdb));
}
TEST(TCPSClientGTest, TestInitialise_RejectsNegativeTimes) {
{
TCPSClient c;
ConfigurationDatabase cdb;
(void)cdb.Write("Port", static_cast<uint32>(44500u));
(void)cdb.Write("SilenceTimeout", -1.0f);
EXPECT_FALSE(c.Initialise(cdb));
}
{
TCPSClient c;
ConfigurationDatabase cdb;
(void)cdb.Write("Port", static_cast<uint32>(44500u));
(void)cdb.Write("ReconnectDelay", -1.0f);
EXPECT_FALSE(c.Initialise(cdb));
}
}
TEST(TCPSClientGTest, TestReceivesConfigThenData) {
TCPSServer server;
ASSERT_TRUE(InitServer(server, 0u));
ASSERT_TRUE(server.Start());
std::vector<uint8> cfg = Pattern(136u * 2u + 16u, 4u);
ASSERT_TRUE(server.SendConfig(&cfg[0], static_cast<uint32>(cfg.size())));
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, server.GetPort()));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
bool ok;
PUMP_UNTIL(server, rec.NumConfigs() == 1u, 3000u, ok);
ASSERT_TRUE(ok);
EXPECT_TRUE(client.IsConnected());
EXPECT_EQ(1u, rec.Connects());
EXPECT_EQ(cfg, rec.Config(0u));
for (uint32 c = 1u; c <= 20u; c++) {
std::vector<uint8> d = Pattern(300u, static_cast<uint8>(c));
ASSERT_TRUE(server.SendData(c, &d[0], 300u));
}
PUMP_UNTIL(server, rec.NumDatas() == 20u, 3000u, ok);
ASSERT_TRUE(ok);
for (uint32 c = 1u; c <= 20u; c++) {
EXPECT_EQ(Pattern(300u, static_cast<uint8>(c)), rec.Data(c - 1u));
EXPECT_EQ(c, rec.Counter(c - 1u));
}
EXPECT_EQ("C" + std::string(20, 'D'), rec.Order());
EXPECT_EQ(0u, client.GetProtocolErrors());
EXPECT_TRUE(client.Stop());
EXPECT_EQ(1u, rec.Disconnects());
server.Stop();
}
TEST(TCPSClientGTest, TestLargeFrame) {
TCPSServer server;
ASSERT_TRUE(InitServer(server, 0u));
ASSERT_TRUE(server.Start());
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, server.GetPort()));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
bool ok;
PUMP_UNTIL(server, server.GetClientCount() == 1u, 3000u, ok);
ASSERT_TRUE(ok);
std::vector<uint8> big = Pattern(900000u, 11u);
ASSERT_TRUE(server.SendData(1u, &big[0], static_cast<uint32>(big.size())));
PUMP_UNTIL(server, rec.NumDatas() == 1u, 5000u, ok);
ASSERT_TRUE(ok);
EXPECT_TRUE(big == rec.Data(0u));
client.Stop();
server.Stop();
}
TEST(TCPSClientGTest, TestReconnectAfterServerRestart) {
uint16 port = 0u;
int probe = Listen(port);
ASSERT_GE(probe, 0);
close(probe);
TCPSServer server;
ASSERT_TRUE(InitServer(server, port));
ASSERT_TRUE(server.Start());
std::vector<uint8> cfg = Pattern(40u, 2u);
ASSERT_TRUE(server.SendConfig(&cfg[0], 40u));
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, port, 0.2f));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
bool ok;
PUMP_UNTIL(server, rec.NumConfigs() == 1u, 3000u, ok);
ASSERT_TRUE(ok);
server.Stop();
WAIT_UNTIL(!client.IsConnected(), 3000u, ok);
EXPECT_TRUE(ok);
EXPECT_EQ(1u, rec.Disconnects());
std::vector<uint8> cfg2 = Pattern(60u, 9u);
ASSERT_TRUE(server.Start());
ASSERT_TRUE(server.SendConfig(&cfg2[0], 60u));
PUMP_UNTIL(server, rec.NumConfigs() == 2u, 4000u, ok);
ASSERT_TRUE(ok);
EXPECT_EQ(cfg2, rec.Config(1u));
EXPECT_EQ(2u, client.GetConnectionCount());
EXPECT_EQ(2u, rec.Connects());
client.Stop();
server.Stop();
}
TEST(TCPSClientGTest, TestRejectsBadMagic_ThenRecovers) {
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, port, 0.1f));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
int s1 = AcceptOne(lfd, 3000);
ASSERT_GE(s1, 0);
std::vector<uint8> junk(UDPS_HEADER_SIZE, 0xAAu);
ASSERT_TRUE(SendAll(s1, &junk[0], junk.size()));
bool ok;
WAIT_UNTIL(client.GetProtocolErrors() == 1u, 3000u, ok);
EXPECT_TRUE(ok);
EXPECT_TRUE(PeerClosed(s1, 1000));
close(s1);
// The client re-opens the connection and a well-formed stream works.
int s2 = AcceptOne(lfd, 3000);
ASSERT_GE(s2, 0);
std::vector<uint8> cfg = Pattern(20u, 1u);
std::vector<uint8> f = MakeFrame(UDPS_TYPE_CONFIG, 1u, cfg);
ASSERT_TRUE(SendAll(s2, &f[0], f.size()));
WAIT_UNTIL(rec.NumConfigs() == 1u, 3000u, ok);
EXPECT_TRUE(ok);
EXPECT_EQ(0u, rec.NumDatas());
client.Stop();
close(s2);
close(lfd);
}
TEST(TCPSClientGTest, TestRejectsOversizeLength) {
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, port, 5.0f)); // no quick reconnect
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
int s = AcceptOne(lfd, 3000);
ASSERT_GE(s, 0);
uint8 hdr[UDPS_HEADER_SIZE];
UDPSBuildHeader(hdr, UDPS_TYPE_DATA, 1u, 0u, 1u, UDPSClient::UDPS_CLIENT_MAX_PACKET_BYTES + 1u);
ASSERT_TRUE(SendAll(s, hdr, sizeof(hdr)));
bool ok;
WAIT_UNTIL(client.GetProtocolErrors() == 1u, 3000u, ok);
EXPECT_TRUE(ok);
EXPECT_FALSE(client.IsConnected());
EXPECT_EQ(0u, rec.NumDatas());
client.Stop();
close(s);
close(lfd);
}
TEST(TCPSClientGTest, TestRejectsFragmentedFrame) {
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, port, 5.0f));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
int s = AcceptOne(lfd, 3000);
ASSERT_GE(s, 0);
std::vector<uint8> f = MakeFrame(UDPS_TYPE_DATA, 1u, Pattern(10u, 1u), 2u);
ASSERT_TRUE(SendAll(s, &f[0], f.size()));
bool ok;
WAIT_UNTIL(client.GetProtocolErrors() == 1u, 3000u, ok);
EXPECT_TRUE(ok);
EXPECT_EQ(0u, rec.NumDatas());
client.Stop();
close(s);
close(lfd);
}
TEST(TCPSClientGTest, TestPartialFrameReads) {
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, port, 0.1f));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
int s = AcceptOne(lfd, 3000);
ASSERT_GE(s, 0);
std::vector<uint8> p1 = Pattern(64u, 1u);
std::vector<uint8> p2 = Pattern(3000u, 2u);
std::vector<uint8> f1 = MakeFrame(UDPS_TYPE_CONFIG, 1u, p1);
std::vector<uint8> f2 = MakeFrame(UDPS_TYPE_DATA, 5u, p2);
// Frame 1: one byte at a time, so header and payload both split.
for (size_t i = 0u; i < f1.size(); i++) {
ASSERT_TRUE(SendAll(s, &f1[i], 1u));
if ((i % 8u) == 0u) {
Sleep::MSec(2u);
}
}
// Frame 2: split in three uneven chunks with pauses.
size_t cuts[3] = {5u, 20u, f2.size() - 25u};
size_t at = 0u;
for (int k = 0; k < 3; k++) {
ASSERT_TRUE(SendAll(s, &f2[at], cuts[k] - at));
at = cuts[k];
Sleep::MSec(80u);
}
ASSERT_TRUE(SendAll(s, &f2[at], f2.size() - at));
// Frames 3+4 coalesced in one write.
std::vector<uint8> f3 = MakeFrame(UDPS_TYPE_DATA, 6u, Pattern(10u, 3u));
std::vector<uint8> f4 = MakeFrame(UDPS_TYPE_DATA, 7u, Pattern(0u, 0u));
std::vector<uint8> both(f3);
both.insert(both.end(), f4.begin(), f4.end());
ASSERT_TRUE(SendAll(s, &both[0], both.size()));
bool ok;
WAIT_UNTIL(rec.NumDatas() == 3u, 3000u, ok);
ASSERT_TRUE(ok);
EXPECT_EQ(p1, rec.Config(0u));
EXPECT_EQ(p2, rec.Data(0u));
EXPECT_EQ(Pattern(10u, 3u), rec.Data(1u));
EXPECT_EQ(0u, rec.Data(2u).size());
EXPECT_EQ(5u, rec.Counter(0u));
EXPECT_EQ(7u, rec.Counter(2u));
EXPECT_EQ(0u, client.GetProtocolErrors());
client.Stop();
close(s);
close(lfd);
}
TEST(TCPSClientGTest, TestUnknownFrameTypeIgnored) {
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, port));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
int s = AcceptOne(lfd, 3000);
ASSERT_GE(s, 0);
std::vector<uint8> a = MakeFrame(UDPS_TYPE_ACK, 1u, Pattern(4u, 1u));
std::vector<uint8> b = MakeFrame(UDPS_TYPE_DATA, 2u, Pattern(4u, 2u));
ASSERT_TRUE(SendAll(s, &a[0], a.size()));
ASSERT_TRUE(SendAll(s, &b[0], b.size()));
bool ok;
WAIT_UNTIL(rec.NumDatas() == 1u, 3000u, ok);
EXPECT_TRUE(ok);
EXPECT_EQ(0u, client.GetProtocolErrors());
client.Stop();
close(s);
close(lfd);
}
TEST(TCPSClientGTest, TestSilenceTimeoutReconnects) {
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, port, 0.1f, 0.3f));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
// The peer never sends anything: the client must give up and retry.
bool ok;
WAIT_UNTIL(client.GetConnectionCount() >= 2u, 4000u, ok);
EXPECT_TRUE(ok);
EXPECT_GE(rec.Disconnects(), 1u);
client.Stop();
close(lfd);
}
TEST(TCPSClientGTest, TestNoServer_RetriesAndStopsPromptly) {
uint16 port = 0u;
int probe = Listen(port);
ASSERT_GE(probe, 0);
close(probe); // nothing listens on `port` now
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, port, 0.05f));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
Sleep::MSec(300u);
EXPECT_FALSE(client.IsConnected());
EXPECT_EQ(0u, client.GetConnectionCount());
const uint64 t0 = NowMs();
EXPECT_TRUE(client.Stop());
EXPECT_LT(NowMs() - t0, 1000u);
// A server appearing later is picked up on restart.
TCPSServer server;
ASSERT_TRUE(InitServer(server, port));
ASSERT_TRUE(server.Start());
ASSERT_TRUE(client.Start());
bool ok;
PUMP_UNTIL(server, client.IsConnected(), 3000u, ok);
EXPECT_TRUE(ok);
client.Stop();
server.Stop();
}
TEST(TCPSClientGTest, TestStopWhileConnected_IsPrompt) {
TCPSServer server;
ASSERT_TRUE(InitServer(server, 0u));
ASSERT_TRUE(server.Start());
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitClient(client, server.GetPort()));
client.SetListener(&rec);
ASSERT_TRUE(client.Start());
bool ok;
PUMP_UNTIL(server, client.IsConnected(), 3000u, ok);
ASSERT_TRUE(ok);
const uint64 t0 = NowMs();
EXPECT_TRUE(client.Stop());
EXPECT_LT(NowMs() - t0, 1000u);
EXPECT_FALSE(client.IsConnected());
PUMP_UNTIL(server, server.GetClientCount() == 0u, 2000u, ok);
EXPECT_TRUE(ok);
server.Stop();
}
// ---------------------------------------------------------------------------
// Multiplexed connections (StreamName = "a,b,c")
// ---------------------------------------------------------------------------
namespace {
bool InitMuxClient(TCPSClient &c, uint16 port, const char *names) {
ConfigurationDatabase cdb;
(void)cdb.Write("ServerAddr", "127.0.0.1");
(void)cdb.Write("Port", static_cast<uint32>(port));
(void)cdb.Write("ReconnectDelay", 5.0f);
(void)cdb.Write("StreamName", names);
return c.Initialise(cdb);
}
/** Records the per-stream gap reported while each DATA frame is delivered. */
class GapRecorder : public Recorder {
public:
GapRecorder() : source(NULL_PTR(UDPSClientI *)) {}
void Watch(UDPSClientI *s) { source = s; }
virtual void OnUDPSData(const uint8 *p, uint32 n) {
gaps.push_back(source != NULL_PTR(UDPSClientI *) ? source->GetLastDataGap() : 0xFFFFu);
Recorder::OnUDPSData(p, n);
}
std::vector<uint32> gaps; // read only after NumDatas() reached its target
private:
UDPSClientI *source;
};
} // namespace
TEST(TCPSClientGTest, TestMux_StreamNameValidation) {
const char *const bad[] = { "a,,b", ",a", "a,", "a,b,a" };
for (size_t i = 0u; i < sizeof(bad) / sizeof(bad[0]); i++) {
TCPSClient c;
EXPECT_FALSE(InitMuxClient(c, 44500u, bad[i])) << bad[i];
}
{
// 65 distinct names exceed the 64 stream limit.
std::string many;
for (int i = 0; i < 65; i++) {
char b[16];
snprintf(b, sizeof(b), "%ss%d", i ? "," : "", i);
many += b;
}
TCPSClient c;
EXPECT_FALSE(InitMuxClient(c, 44500u, many.c_str()));
}
{
TCPSClient c;
ASSERT_TRUE(InitMuxClient(c, 44500u, "fast,slow,third"));
EXPECT_EQ(3u, c.GetNumStreams());
EXPECT_TRUE(c.GetStream(0u) != NULL_PTR(UDPSClientI *));
EXPECT_TRUE(c.GetStream(2u) != NULL_PTR(UDPSClientI *));
EXPECT_TRUE(c.GetStream(3u) == NULL_PTR(UDPSClientI *));
}
{
TCPSClient c;
ASSERT_TRUE(InitMuxClient(c, 44500u, "only"));
EXPECT_EQ(1u, c.GetNumStreams());
}
}
TEST(TCPSClientGTest, TestMux_SendsListAndDemuxesByIndex) {
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
GapRecorder r0, r1;
TCPSClient client;
ASSERT_TRUE(InitMuxClient(client, port, "fast,slow"));
r0.Watch(client.GetStream(0u));
r1.Watch(client.GetStream(1u));
client.GetStream(0u)->SetListener(&r0);
client.GetStream(1u)->SetListener(&r1);
ASSERT_TRUE(client.GetStream(0u)->Start());
int s = AcceptOne(lfd, 3000);
ASSERT_GE(s, 0);
Frame sub;
ASSERT_TRUE(ReadFrame(s, sub, 3000));
EXPECT_EQ(UDPS_TYPE_SUBSCRIBE, sub.type);
EXPECT_EQ(std::string("fast,slow"), std::string(sub.payload.begin(), sub.payload.end()));
std::vector<uint8> cfg0 = Pattern(20u, 1u);
std::vector<uint8> cfg1 = Pattern(30u, 2u);
std::vector<uint8> f;
f = MakeFrame(UDPS_TYPE_CONFIG, 1u, cfg0, 1u, 0u);
ASSERT_TRUE(SendAll(s, &f[0], f.size()));
f = MakeFrame(UDPS_TYPE_CONFIG, 1u, cfg1, 1u, 1u);
ASSERT_TRUE(SendAll(s, &f[0], f.size()));
// Stream 0: counters 1,2,3 ; stream 1: counters 10, 13 (gap of 2).
const uint32 c0[] = { 1u, 2u, 3u };
for (size_t i = 0u; i < 3u; i++) {
f = MakeFrame(UDPS_TYPE_DATA, c0[i], Pattern(8u, static_cast<uint8>(c0[i])), 1u, 0u);
ASSERT_TRUE(SendAll(s, &f[0], f.size()));
}
const uint32 c1[] = { 10u, 13u };
for (size_t i = 0u; i < 2u; i++) {
f = MakeFrame(UDPS_TYPE_DATA, c1[i], Pattern(12u, static_cast<uint8>(c1[i])), 1u, 1u);
ASSERT_TRUE(SendAll(s, &f[0], f.size()));
}
bool ok;
WAIT_UNTIL(r0.NumDatas() == 3u && r1.NumDatas() == 2u, 3000u, ok);
ASSERT_TRUE(ok);
EXPECT_EQ(cfg0, r0.Config(0u));
EXPECT_EQ(cfg1, r1.Config(0u));
EXPECT_EQ(1u, r0.NumConfigs());
EXPECT_EQ(1u, r1.NumConfigs());
EXPECT_EQ(Pattern(8u, 3u), r0.Data(2u));
EXPECT_EQ(Pattern(12u, 13u), r1.Data(1u));
ASSERT_EQ(3u, r0.gaps.size());
ASSERT_EQ(2u, r1.gaps.size());
EXPECT_EQ(0u, r0.gaps[0]);
EXPECT_EQ(0u, r0.gaps[2]);
EXPECT_EQ(0u, r1.gaps[0]);
EXPECT_EQ(2u, r1.gaps[1]) << "gaps are tracked per stream";
EXPECT_EQ(0u, client.GetProtocolErrors());
client.GetStream(0u)->Stop();
close(s);
close(lfd);
}
TEST(TCPSClientGTest, TestMux_StreamIndexOutOfRangeIsProtocolError) {
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
Recorder rec;
TCPSClient client;
ASSERT_TRUE(InitMuxClient(client, port, "a,b"));
client.GetStream(0u)->SetListener(&rec);
ASSERT_TRUE(client.GetStream(0u)->Start());
int s = AcceptOne(lfd, 3000);
ASSERT_GE(s, 0);
std::vector<uint8> f = MakeFrame(UDPS_TYPE_DATA, 1u, Pattern(8u, 1u), 1u, 2u);
ASSERT_TRUE(SendAll(s, &f[0], f.size()));
bool ok;
WAIT_UNTIL(client.GetProtocolErrors() == 1u, 3000u, ok);
EXPECT_TRUE(ok);
EXPECT_EQ(0u, rec.NumDatas());
client.GetStream(0u)->Stop();
close(s);
close(lfd);
}
TEST(TCPSClientGTest, TestMux_FacadeStartStopIsReferenceCounted) {
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
TCPSClient client;
ASSERT_TRUE(InitMuxClient(client, port, "a,b"));
UDPSClientI *a = client.GetStream(0u);
UDPSClientI *b = client.GetStream(1u);
ASSERT_TRUE(a->Start());
ASSERT_TRUE(a->Start()); // idempotent per facade
ASSERT_TRUE(b->Start());
int s = AcceptOne(lfd, 3000);
ASSERT_GE(s, 0);
bool ok;
WAIT_UNTIL(client.IsConnected(), 3000u, ok);
EXPECT_TRUE(ok);
EXPECT_TRUE(a->Stop());
EXPECT_TRUE(a->Stop());
Sleep::MSec(150u);
EXPECT_TRUE(client.IsConnected()) << "b still wants the connection";
EXPECT_TRUE(b->Stop());
WAIT_UNTIL(!client.IsConnected(), 3000u, ok);
EXPECT_TRUE(ok);
Frame sub; // drain the SUBSCRIBE the client sent on connect
EXPECT_TRUE(ReadFrame(s, sub, 1000));
EXPECT_TRUE(PeerClosed(s, 1000));
close(s);
close(lfd);
}
+455
View File
@@ -0,0 +1,455 @@
/**
* @file TCPSServerGTest.cpp
* @brief GTest coverage for TCPSServer (UDPS framing over TCP, producer side).
*
* The server is driven the way UDPStreamer drives it (single thread:
* ServiceClients / SendConfig / SendData) and observed through raw loopback
* sockets, so these tests pin down the wire behaviour.
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*/
#define DLL_API
#include "gtest/gtest.h"
#include <pthread.h>
#include <unistd.h>
#include "ConfigurationDatabase.h"
#include "Sleep.h"
#include "TCPSServer.h"
#include "TCPTestUtil.h"
using namespace MARTe;
using namespace tcptest;
namespace {
/** Initialise @p server on an ephemeral port with the given limits. */
bool InitServer(TCPSServer &server, uint32 maxPayload = 60000u, uint32 maxClients = 16u,
uint32 depth = 8u, uint32 stallS = 5u, uint32 sndBuf = 0u) {
ConfigurationDatabase cdb;
(void)cdb.Write("Port", static_cast<uint32>(0u));
(void)cdb.Write("MaxPayloadSize", maxPayload);
(void)cdb.Write("MaxClients", maxClients);
(void)cdb.Write("ClientQueueDepth", depth);
(void)cdb.Write("ClientStallTimeout", stallS);
(void)cdb.Write("SendBufferSize", sndBuf);
return server.Initialise(cdb);
}
/** Pump ServiceClients() until @p n clients are attached. */
bool WaitClients(TCPSServer &server, uint32 n, uint32 timeoutMs) {
const uint64 deadline = NowMs() + timeoutMs;
while (NowMs() < deadline) {
server.ServiceClients();
if (server.GetClientCount() == n) {
return true;
}
Sleep::MSec(5u);
}
return false;
}
/** Pump ServiceClients() for @p ms. */
void Pump(TCPSServer &server, uint32 ms) {
const uint64 deadline = NowMs() + ms;
while (NowMs() < deadline) {
server.ServiceClients();
Sleep::MSec(5u);
}
}
struct FastReader {
int fd;
std::vector<uint32> counters;
std::vector<uint8> configPayload;
bool sawConfigFirst;
bool badFrame;
uint32 stopAt;
};
void *FastReaderMain(void *arg) {
FastReader *r = static_cast<FastReader *>(arg);
r->sawConfigFirst = false;
r->badFrame = false;
bool first = true;
Frame f;
for (;;) {
if (!ReadFrame(r->fd, f, 3000)) {
break;
}
if (first) {
r->sawConfigFirst = (f.type == UDPS_TYPE_CONFIG);
first = false;
}
if (f.type == UDPS_TYPE_CONFIG) {
r->configPayload = f.payload;
} else if (f.type == UDPS_TYPE_DATA) {
r->counters.push_back(f.counter);
if (f.payload.size() != 60000u) {
r->badFrame = true;
}
if (f.counter >= r->stopAt) {
break;
}
} else {
r->badFrame = true;
}
}
return NULL;
}
} // namespace
TEST(TCPSServerGTest, TestInitialise_Defaults) {
TCPSServer server;
ConfigurationDatabase cdb;
ASSERT_TRUE(server.Initialise(cdb));
EXPECT_EQ(TCPSServer::TCPS_DEFAULT_MAX_PAYLOAD, server.GetMaxPayloadSize());
EXPECT_EQ(static_cast<uint16>(TCPSServer::TCPS_DEFAULT_PORT), server.GetPort());
EXPECT_FALSE(server.IsMulticast());
EXPECT_FALSE(server.HasClients());
}
TEST(TCPSServerGTest, TestInitialise_RejectsBadValues) {
{
TCPSServer s;
ConfigurationDatabase cdb;
(void)cdb.Write("MaxPayloadSize", static_cast<uint32>(0u));
EXPECT_FALSE(s.Initialise(cdb));
}
{
TCPSServer s;
ConfigurationDatabase cdb;
(void)cdb.Write("MaxPayloadSize", static_cast<uint32>(2000000u));
EXPECT_FALSE(s.Initialise(cdb));
}
{
TCPSServer s;
ConfigurationDatabase cdb;
(void)cdb.Write("ClientQueueDepth", static_cast<uint32>(0u));
EXPECT_FALSE(s.Initialise(cdb));
}
{
TCPSServer s;
ConfigurationDatabase cdb;
(void)cdb.Write("MaxClients", static_cast<uint32>(0u));
EXPECT_FALSE(s.Initialise(cdb));
}
{
TCPSServer s;
ConfigurationDatabase cdb;
(void)cdb.Write("Port", static_cast<uint32>(70000u));
EXPECT_FALSE(s.Initialise(cdb));
}
}
TEST(TCPSServerGTest, TestStartStop_Idempotent) {
TCPSServer server;
ASSERT_TRUE(InitServer(server));
ASSERT_TRUE(server.Start());
EXPECT_TRUE(server.Start());
EXPECT_NE(0u, server.GetPort());
EXPECT_TRUE(server.Stop());
EXPECT_TRUE(server.Stop());
ASSERT_TRUE(server.Start());
EXPECT_NE(0u, server.GetPort());
EXPECT_TRUE(server.Stop());
}
TEST(TCPSServerGTest, TestConfigBeforeData_LateJoin) {
TCPSServer server;
ASSERT_TRUE(InitServer(server));
ASSERT_TRUE(server.Start());
std::vector<uint8> cfg = Pattern(40u, 3u);
ASSERT_TRUE(server.SendConfig(&cfg[0], 40u));
std::vector<uint8> d = Pattern(100u, 9u);
EXPECT_TRUE(server.SendData(1u, &d[0], 100u)); // nobody listening: harmless
int fd = Connect(server.GetPort());
ASSERT_GE(fd, 0);
ASSERT_TRUE(WaitClients(server, 1u, 2000u));
EXPECT_TRUE(server.HasClients());
ASSERT_TRUE(server.SendData(2u, &d[0], 100u));
Frame f;
ASSERT_TRUE(ReadFrame(fd, f, 2000));
EXPECT_EQ(UDPS_TYPE_CONFIG, f.type);
EXPECT_EQ(1u, f.totalFragments);
EXPECT_EQ(cfg, f.payload);
ASSERT_TRUE(ReadFrame(fd, f, 2000));
EXPECT_EQ(UDPS_TYPE_DATA, f.type);
EXPECT_EQ(2u, f.counter);
EXPECT_EQ(d, f.payload);
close(fd);
server.Stop();
}
TEST(TCPSServerGTest, TestMultipleClients_InOrder) {
TCPSServer server;
ASSERT_TRUE(InitServer(server, 60000u, 16u, 64u));
ASSERT_TRUE(server.Start());
std::vector<uint8> cfg = Pattern(24u, 1u);
ASSERT_TRUE(server.SendConfig(&cfg[0], 24u));
int fds[3];
for (int i = 0; i < 3; i++) {
fds[i] = Connect(server.GetPort());
ASSERT_GE(fds[i], 0);
}
ASSERT_TRUE(WaitClients(server, 3u, 2000u));
for (uint32 c = 1u; c <= 50u; c++) {
std::vector<uint8> d = Pattern(200u, static_cast<uint8>(c));
ASSERT_TRUE(server.SendData(c, &d[0], 200u));
}
for (int i = 0; i < 3; i++) {
Frame f;
ASSERT_TRUE(ReadFrame(fds[i], f, 2000));
EXPECT_EQ(UDPS_TYPE_CONFIG, f.type);
for (uint32 c = 1u; c <= 50u; c++) {
ASSERT_TRUE(ReadFrame(fds[i], f, 2000)) << "client " << i << " frame " << c;
EXPECT_EQ(UDPS_TYPE_DATA, f.type);
ASSERT_EQ(c, f.counter);
EXPECT_EQ(Pattern(200u, static_cast<uint8>(c)), f.payload);
}
close(fds[i]);
}
EXPECT_EQ(0u, server.GetClientDrops());
server.Stop();
}
TEST(TCPSServerGTest, TestReconfigDeliveredToConnectedClient) {
TCPSServer server;
ASSERT_TRUE(InitServer(server));
ASSERT_TRUE(server.Start());
int fd = Connect(server.GetPort());
ASSERT_GE(fd, 0);
ASSERT_TRUE(WaitClients(server, 1u, 2000u));
std::vector<uint8> cfg1 = Pattern(30u, 1u);
std::vector<uint8> cfg2 = Pattern(50u, 2u);
std::vector<uint8> d = Pattern(64u, 5u);
ASSERT_TRUE(server.SendConfig(&cfg1[0], 30u));
ASSERT_TRUE(server.SendData(1u, &d[0], 64u));
Frame f;
ASSERT_TRUE(ReadFrame(fd, f, 2000));
EXPECT_EQ(cfg1, f.payload);
ASSERT_TRUE(ReadFrame(fd, f, 2000));
EXPECT_EQ(1u, f.counter);
ASSERT_TRUE(server.SendConfig(&cfg2[0], 50u));
ASSERT_TRUE(server.SendData(2u, &d[0], 64u));
ASSERT_TRUE(ReadFrame(fd, f, 2000));
EXPECT_EQ(UDPS_TYPE_CONFIG, f.type);
EXPECT_EQ(cfg2, f.payload);
ASSERT_TRUE(ReadFrame(fd, f, 2000));
EXPECT_EQ(UDPS_TYPE_DATA, f.type);
EXPECT_EQ(2u, f.counter);
// A client joining now gets the NEW config.
int fd2 = Connect(server.GetPort());
ASSERT_GE(fd2, 0);
ASSERT_TRUE(WaitClients(server, 2u, 2000u));
ASSERT_TRUE(ReadFrame(fd2, f, 2000));
EXPECT_EQ(UDPS_TYPE_CONFIG, f.type);
EXPECT_EQ(cfg2, f.payload);
close(fd);
close(fd2);
server.Stop();
}
TEST(TCPSServerGTest, TestMaxClientsRefused) {
TCPSServer server;
ASSERT_TRUE(InitServer(server, 60000u, 2u));
ASSERT_TRUE(server.Start());
int fds[3];
for (int i = 0; i < 3; i++) {
fds[i] = Connect(server.GetPort());
ASSERT_GE(fds[i], 0);
}
Pump(server, 300u);
EXPECT_EQ(2u, server.GetClientCount());
int closedCount = 0;
for (int i = 0; i < 3; i++) {
if (PeerClosed(fds[i], 200)) {
closedCount++;
}
close(fds[i]);
}
EXPECT_EQ(1, closedCount);
server.Stop();
}
TEST(TCPSServerGTest, TestPeerCloseEvicts) {
TCPSServer server;
ASSERT_TRUE(InitServer(server));
ASSERT_TRUE(server.Start());
int fd = Connect(server.GetPort());
ASSERT_GE(fd, 0);
ASSERT_TRUE(WaitClients(server, 1u, 2000u));
close(fd);
EXPECT_TRUE(WaitClients(server, 0u, 2000u));
EXPECT_FALSE(server.HasClients());
// The slot is reusable.
fd = Connect(server.GetPort());
ASSERT_GE(fd, 0);
EXPECT_TRUE(WaitClients(server, 1u, 2000u));
close(fd);
server.Stop();
}
TEST(TCPSServerGTest, TestOversizeFrameRefused) {
TCPSServer server;
ASSERT_TRUE(InitServer(server));
ASSERT_TRUE(server.Start());
int fd = Connect(server.GetPort());
ASSERT_GE(fd, 0);
ASSERT_TRUE(WaitClients(server, 1u, 2000u));
std::vector<uint8> big(TCPSServer::TCPS_MAX_FRAME_PAYLOAD + 1u, 0u);
EXPECT_FALSE(server.SendData(1u, &big[0], static_cast<uint32>(big.size())));
EXPECT_FALSE(server.SendConfig(&big[0], static_cast<uint32>(big.size())));
EXPECT_TRUE(server.HasClients());
// A frame between MaxPayloadSize and the hard limit is still carried.
std::vector<uint8> mid(100000u, 7u);
EXPECT_TRUE(server.SendData(2u, &mid[0], static_cast<uint32>(mid.size())));
Frame f;
ASSERT_TRUE(ReadFrame(fd, f, 2000));
EXPECT_EQ(2u, f.counter);
EXPECT_EQ(mid.size(), f.payload.size());
close(fd);
server.Stop();
}
TEST(TCPSServerGTest, TestSlowClientDrops_FastClientComplete) {
TCPSServer server;
ASSERT_TRUE(InitServer(server, 60000u, 16u, 32u, 0u, 65536u));
ASSERT_TRUE(server.Start());
std::vector<uint8> cfg = Pattern(24u, 1u);
ASSERT_TRUE(server.SendConfig(&cfg[0], 24u));
int slow = Connect(server.GetPort(), 4096);
int fast = Connect(server.GetPort());
ASSERT_GE(slow, 0);
ASSERT_GE(fast, 0);
ASSERT_TRUE(WaitClients(server, 2u, 2000u));
FastReader reader;
reader.fd = fast;
reader.stopAt = 200u;
pthread_t th;
ASSERT_EQ(0, pthread_create(&th, NULL, FastReaderMain, &reader));
for (uint32 c = 1u; c <= 200u; c++) {
std::vector<uint8> d = Pattern(60000u, static_cast<uint8>(c));
ASSERT_TRUE(server.SendData(c, &d[0], 60000u));
server.ServiceClients();
Sleep::MSec(2u);
}
// Drain the slow client: the stream must still be well-formed, begin with
// CONFIG and have strictly increasing counters (gaps = dropped frames).
uint32 slowFrames = 0u;
uint32 lastCounter = 0u;
bool slowFirstConfig = false;
bool slowInOrder = true;
uint32 idle = 0u;
while (idle < 20u) {
server.ServiceClients();
Frame f;
if (ReadFrame(slow, f, 10)) {
idle = 0u;
if (slowFrames == 0u) {
slowFirstConfig = (f.type == UDPS_TYPE_CONFIG);
}
if (f.type == UDPS_TYPE_DATA) {
if (f.counter <= lastCounter) {
slowInOrder = false;
}
lastCounter = f.counter;
if (f.payload.size() != 60000u) {
slowInOrder = false;
}
}
slowFrames++;
} else {
idle++;
}
}
pthread_join(th, NULL);
ASSERT_EQ(200u, reader.counters.size());
for (uint32 i = 0u; i < 200u; i++) {
ASSERT_EQ(i + 1u, reader.counters[i]);
}
EXPECT_TRUE(reader.sawConfigFirst);
EXPECT_FALSE(reader.badFrame);
EXPECT_GT(server.GetClientDrops(), 100u);
EXPECT_TRUE(slowFirstConfig);
EXPECT_TRUE(slowInOrder);
EXPECT_GT(slowFrames, 1u);
EXPECT_LT(slowFrames, 201u); // some frames were dropped for it
EXPECT_EQ(2u, server.GetClientCount());
close(slow);
close(fast);
server.Stop();
}
TEST(TCPSServerGTest, TestStallDisconnect) {
TCPSServer server;
ASSERT_TRUE(InitServer(server, 60000u, 16u, 4u, 1u, 8192u));
ASSERT_TRUE(server.Start());
int slow = Connect(server.GetPort(), 4096);
ASSERT_GE(slow, 0);
ASSERT_TRUE(WaitClients(server, 1u, 2000u));
std::vector<uint8> d = Pattern(60000u, 1u);
for (uint32 c = 1u; c <= 6u; c++) {
ASSERT_TRUE(server.SendData(c, &d[0], 60000u));
}
EXPECT_TRUE(server.HasClients()); // not yet: the stall clock is still running
const uint64 t0 = NowMs();
EXPECT_TRUE(WaitClients(server, 0u, 4000u));
EXPECT_GE(NowMs() - t0, 800u); // evicted by the timeout, not at once
EXPECT_EQ(1u, server.GetStallEvictions());
close(slow);
server.Stop();
}
TEST(TCPSServerGTest, TestStallDisabled_KeepsClient) {
TCPSServer server;
ASSERT_TRUE(InitServer(server, 60000u, 16u, 4u, 0u, 8192u));
ASSERT_TRUE(server.Start());
int slow = Connect(server.GetPort(), 4096);
ASSERT_GE(slow, 0);
ASSERT_TRUE(WaitClients(server, 1u, 2000u));
std::vector<uint8> d = Pattern(60000u, 1u);
for (uint32 c = 1u; c <= 6u; c++) {
ASSERT_TRUE(server.SendData(c, &d[0], 60000u));
}
Pump(server, 1500u);
EXPECT_EQ(1u, server.GetClientCount());
EXPECT_EQ(0u, server.GetStallEvictions());
close(slow);
server.Stop();
}
File diff suppressed because it is too large. Load diff
+434
View File
@@ -0,0 +1,434 @@
/**
* @file TCPStreamerGTest.cpp
* @brief GTests for the TCPStreamer / TCPStreamerClient DataSources.
*
* Each test builds a RealTimeApplication from a configuration string (the same
* pattern as the UDPStreamer tests). No scheduler thread is started: the tests
* write the DataSource memory and call Synchronise() themselves.
*/
#define DLL_API
#include <stdio.h>
#include <string.h>
#include <string>
#include "gtest/gtest.h"
#include "AdvancedErrorManagement.h"
#include "ClassRegistryDatabase.h"
#include "ConfigurationDatabase.h"
#include "GAM.h"
#include "MemoryOperationsHelper.h"
#include "ObjectRegistryDatabase.h"
#include "RealTimeApplication.h"
#include "Sleep.h"
#include "StandardParser.h"
#include "TCPStreamer.h"
#include "TCPStreamerClient.h"
#include "TCPTestUtil.h"
#include "UDPSProtocol.h"
using namespace MARTe;
using namespace tcptest;
namespace {
/** Output-only GAM; its presence is what makes the streamer DataSource configure. */
class TCPStreamerTestWriterGAM : public GAM {
public:
CLASS_REGISTER_DECLARATION()
TCPStreamerTestWriterGAM() : GAM() {}
virtual ~TCPStreamerTestWriterGAM() {}
virtual bool Setup() { return true; }
virtual bool Execute() { return true; }
};
CLASS_REGISTER(TCPStreamerTestWriterGAM, "1.0")
/** Copies its input to its output; makes the client DataSource configure. */
class TCPStreamerTestReaderGAM : public GAM {
public:
CLASS_REGISTER_DECLARATION()
TCPStreamerTestReaderGAM() : GAM() {}
virtual ~TCPStreamerTestReaderGAM() {}
virtual bool Setup() { return true; }
virtual bool Execute() {
void *in = GetInputSignalMemory(0u);
void *out = GetOutputSignalMemory(0u);
if ((in != NULL_PTR(void *)) && (out != NULL_PTR(void *))) {
(void)MemoryOperationsHelper::Copy(out, in, sizeof(uint32));
}
return true;
}
};
CLASS_REGISTER(TCPStreamerTestReaderGAM, "1.0")
ReferenceT<RealTimeApplication> LoadApplication(const std::string &config) {
ConfigurationDatabase cdb;
StreamString cfgStr = config.c_str();
(void)cfgStr.Seek(0LLU);
StandardParser parser(cfgStr, cdb);
if (!parser.Parse()) {
return ReferenceT<RealTimeApplication>();
}
ObjectRegistryDatabase *god = ObjectRegistryDatabase::Instance();
god->Purge();
if (!god->Initialise(cdb)) {
return ReferenceT<RealTimeApplication>();
}
ReferenceT<RealTimeApplication> app = god->Find("Test");
if (!app.IsValid() || !app->ConfigureApplication()) {
return ReferenceT<RealTimeApplication>();
}
return app;
}
/**
* Application with an optional streamer DS ("Streamer", fed by Writer) and an
* optional client DS ("Client", read by Reader). @p streamerExtra / @p clientExtra
* are spliced verbatim into the DataSource blocks.
*/
std::string BuildConfig(bool withStreamer, const std::string &streamerExtra,
bool withClient, const std::string &clientExtra) {
std::string cfg = "+Test = {\n Class = RealTimeApplication\n +Functions = {\n Class = ReferenceContainer\n";
std::string functions;
if (withStreamer) {
cfg += " +Writer = { Class = TCPStreamerTestWriterGAM\n"
" OutputSignals = { Counter = { DataSource = Streamer Type = uint32 } } }\n";
functions += " Writer";
}
if (withClient) {
cfg += " +Reader = { Class = TCPStreamerTestReaderGAM\n"
" InputSignals = { Counter = { DataSource = Client Type = uint32 } }\n"
" OutputSignals = { Counter = { DataSource = DDB Type = uint32 } } }\n";
functions += " Reader";
}
cfg += " }\n +Data = {\n Class = ReferenceContainer\n";
if (withClient) {
/* A GAMDataSource with no signals fails to allocate, so only add it when used. */
cfg += " DefaultDataSource = DDB\n +DDB = { Class = GAMDataSource }\n";
}
cfg += " +Timings = { Class = TimingDataSource }\n";
if (withStreamer) {
cfg += " +Streamer = { Class = TCPStreamer\n" + streamerExtra +
"\n Signals = { Counter = { Type = uint32 } } }\n";
}
if (withClient) {
cfg += " +Client = { Class = TCPStreamerClient\n" + clientExtra +
"\n Signals = { Counter = { Type = uint32 } } }\n";
}
cfg += " }\n +States = {\n Class = ReferenceContainer\n +State1 = { Class = RealTimeState\n"
" +Threads = { Class = ReferenceContainer\n"
" +Thread1 = { Class = RealTimeThread Functions = {" + functions + " } } } } }\n"
" +Scheduler = { Class = GAMScheduler TimingDataSource = Timings }\n}\n";
return cfg;
}
std::string PortStr(uint16 port) {
char buf[16];
snprintf(buf, sizeof(buf), "%u", static_cast<unsigned>(port));
return buf;
}
/** Closes the application on scope exit so a failing ASSERT cannot leak threads or ports. */
struct AppGuard {
~AppGuard() { ObjectRegistryDatabase::Instance()->Purge(); }
};
void SetCounter(ReferenceT<TCPStreamer> &ds, uint32 v) {
void *mem = NULL_PTR(void *);
ASSERT_TRUE(ds->GetSignalMemoryBuffer(0u, 0u, mem));
memcpy(mem, &v, sizeof(v));
}
/** CONFIG payload for the single uint32 "Counter" signal, Strict publishing. */
std::vector<uint8> MakeConfigPayload() {
std::vector<uint8> p(4u + UDPS_SIGNAL_DESC_SIZE + 1u, 0u);
const uint32 numSigs = 1u;
memcpy(&p[0], &numSigs, 4u);
UDPSSignalDescriptor desc;
memset(&desc, 0, sizeof(desc));
strncpy(desc.name, "Counter", UDPS_MAX_SIGNAL_NAME - 1u);
desc.typeCode = UDPS_TYPECODE_UINT32;
desc.quantType = UDPS_QUANT_NONE;
desc.numDimensions = 0u;
desc.numRows = 1u;
desc.numCols = 1u;
desc.rangeMax = 1.0;
desc.timeMode = UDPS_TIMEMODE_PACKET;
desc.timeSignalIdx = UDPS_NO_TIME_SIGNAL;
memcpy(&p[4], &desc, UDPS_SIGNAL_DESC_SIZE);
p[4u + UDPS_SIGNAL_DESC_SIZE] = UDPS_PUBLISH_STRICT;
return p;
}
/** DATA payload: 8-byte timestamp then the uint32 value. */
std::vector<uint8> MakeDataPayload(uint32 value) {
std::vector<uint8> p(12u, 0u);
memcpy(&p[8], &value, 4u);
return p;
}
} // namespace
/*---------------------------------------------------------------------------*/
/* TCPStreamer */
/*---------------------------------------------------------------------------*/
TEST(TCPStreamerGTest, ClassesAreRegistered) {
ClassRegistryDatabase *db = ClassRegistryDatabase::Instance();
EXPECT_TRUE(db->Find("TCPStreamer") != NULL_PTR(const ClassRegistryItem *));
EXPECT_TRUE(db->Find("TCPStreamerClient") != NULL_PTR(const ClassRegistryItem *));
}
TEST(TCPStreamerGTest, StreamerDefaults) {
AppGuard guard;
ReferenceT<RealTimeApplication> app = LoadApplication(BuildConfig(true, "", false, ""));
ASSERT_TRUE(app.IsValid());
ReferenceT<TCPStreamer> ds = ObjectRegistryDatabase::Instance()->Find("Test.Data.Streamer");
ASSERT_TRUE(ds.IsValid());
EXPECT_EQ(44500u, ds->GetPort());
EXPECT_EQ(60000u, ds->GetMaxPayloadSize());
EXPECT_EQ(0u, ds->GetClientCount());
EXPECT_EQ(0u, ds->GetClientDrops());
EXPECT_FALSE(ds->IsClientConnected());
}
TEST(TCPStreamerGTest, StreamerRejectsUdpOnlyKeys) {
const char *const keys[] = {
"MulticastGroup = \"239.0.0.1\"", "Interface = \"127.0.0.1\"",
"DataPort = 44501", "ClientTimeout = 5"
};
for (size_t i = 0u; i < sizeof(keys) / sizeof(keys[0]); i++) {
AppGuard guard;
ReferenceT<RealTimeApplication> app =
LoadApplication(BuildConfig(true, std::string("Port = 44820\n") + keys[i], false, ""));
EXPECT_FALSE(app.IsValid()) << keys[i];
}
}
TEST(TCPStreamerGTest, StreamerAcceptsAndValidatesTcpKeys) {
{
AppGuard guard;
ReferenceT<RealTimeApplication> app = LoadApplication(BuildConfig(
true, "Port = 44821 MaxClients = 4 ClientQueueDepth = 2 ClientStallTimeout = 0 SendBufferSize = 65536",
false, ""));
EXPECT_TRUE(app.IsValid());
}
const char *const bad[] = { "MaxClients = 0", "ClientQueueDepth = 0", "MaxPayloadSize = 4" };
for (size_t i = 0u; i < sizeof(bad) / sizeof(bad[0]); i++) {
AppGuard guard;
ReferenceT<RealTimeApplication> app =
LoadApplication(BuildConfig(true, std::string("Port = 44822 ") + bad[i], false, ""));
EXPECT_FALSE(app.IsValid()) << bad[i];
}
}
TEST(TCPStreamerGTest, StreamerDeliversConfigThenData) {
AppGuard guard;
ReferenceT<RealTimeApplication> app = LoadApplication(BuildConfig(true, "Port = 44823", false, ""));
ASSERT_TRUE(app.IsValid());
ReferenceT<TCPStreamer> ds = ObjectRegistryDatabase::Instance()->Find("Test.Data.Streamer");
ASSERT_TRUE(ds.IsValid());
ASSERT_TRUE(app->PrepareNextState("State1") == ErrorManagement::NoError);
EXPECT_EQ(44823u, ds->GetBoundPort());
int fd = Connect(44823u);
ASSERT_GE(fd, 0);
Frame f;
ASSERT_TRUE(ReadFrame(fd, f, 3000));
EXPECT_EQ(UDPS_TYPE_CONFIG, f.type);
EXPECT_EQ(1u, f.totalFragments);
ASSERT_GE(f.payload.size(), MakeConfigPayload().size());
uint32 numSigs = 0u;
memcpy(&numSigs, &f.payload[0], 4u);
EXPECT_EQ(1u, numSigs);
UDPSSignalDescriptor desc;
memcpy(&desc, &f.payload[4], UDPS_SIGNAL_DESC_SIZE);
EXPECT_STREQ("Counter", desc.name);
EXPECT_EQ(UDPS_TYPECODE_UINT32, desc.typeCode);
/* The client count updates on the sender thread's next service pass. */
for (int i = 0; (i < 100) && (ds->GetClientCount() == 0u); i++) {
Sleep::MSec(10u);
}
EXPECT_EQ(1u, ds->GetClientCount());
EXPECT_TRUE(ds->IsClientConnected());
for (uint32 v = 100u; v < 105u; v++) {
SetCounter(ds, v);
ASSERT_TRUE(ds->Synchronise());
ASSERT_TRUE(ReadFrame(fd, f, 3000));
EXPECT_EQ(UDPS_TYPE_DATA, f.type);
EXPECT_EQ(1u, f.totalFragments);
ASSERT_EQ(12u, f.payload.size());
uint32 got = 0u;
memcpy(&got, &f.payload[8], 4u);
EXPECT_EQ(v, got);
Sleep::MSec(5u); /* one publication per sender wake-up */
}
close(fd);
}
TEST(TCPStreamerGTest, StreamerSurvivesClientDisconnectAndReconnect) {
AppGuard guard;
ReferenceT<RealTimeApplication> app = LoadApplication(BuildConfig(true, "Port = 44824", false, ""));
ASSERT_TRUE(app.IsValid());
ReferenceT<TCPStreamer> ds = ObjectRegistryDatabase::Instance()->Find("Test.Data.Streamer");
ASSERT_TRUE(ds.IsValid());
ASSERT_TRUE(app->PrepareNextState("State1") == ErrorManagement::NoError);
for (int round = 0; round < 2; round++) {
int fd = Connect(44824u);
ASSERT_GE(fd, 0);
Frame f;
ASSERT_TRUE(ReadFrame(fd, f, 3000));
EXPECT_EQ(UDPS_TYPE_CONFIG, f.type) << "round " << round;
close(fd);
for (int i = 0; (i < 200) && (ds->GetClientCount() != 0u); i++) {
SetCounter(ds, 1u);
(void)ds->Synchronise();
Sleep::MSec(5u);
}
EXPECT_EQ(0u, ds->GetClientCount());
}
}
/*---------------------------------------------------------------------------*/
/* TCPStreamerClient */
/*---------------------------------------------------------------------------*/
TEST(TCPStreamerGTest, ClientDefaultsAndKeys) {
{
AppGuard guard;
ReferenceT<RealTimeApplication> app = LoadApplication(BuildConfig(false, "", true, ""));
EXPECT_TRUE(app.IsValid());
}
{
AppGuard guard;
ReferenceT<RealTimeApplication> app = LoadApplication(BuildConfig(
false, "", true,
"ServerAddress = \"127.0.0.1\" Port = 44825 SilenceTimeout = 1.5 ReconnectDelay = 0.5"));
EXPECT_TRUE(app.IsValid());
}
}
TEST(TCPStreamerGTest, ClientRejectsUdpOnlyKeys) {
const char *const keys[] = {
"MulticastGroup = \"239.0.0.1\"", "DataPort = 44501",
"Interface = \"127.0.0.1\"", "KeepAliveInterval = 2"
};
for (size_t i = 0u; i < sizeof(keys) / sizeof(keys[0]); i++) {
AppGuard guard;
ReferenceT<RealTimeApplication> app =
LoadApplication(BuildConfig(false, "", true, std::string("Port = 44826\n") + keys[i]));
EXPECT_FALSE(app.IsValid()) << keys[i];
}
}
TEST(TCPStreamerGTest, ClientReceivesFromRawServer) {
AppGuard guard;
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
std::string extra = "Port = " + PortStr(port) + " ReconnectDelay = 0.1";
ReferenceT<RealTimeApplication> app = LoadApplication(BuildConfig(false, "", true, extra));
ASSERT_TRUE(app.IsValid());
ReferenceT<TCPStreamerClient> ds = ObjectRegistryDatabase::Instance()->Find("Test.Data.Client");
ASSERT_TRUE(ds.IsValid());
ASSERT_TRUE(app->PrepareNextState("State1") == ErrorManagement::NoError);
int cfd = AcceptOne(lfd, 3000);
ASSERT_GE(cfd, 0);
ASSERT_TRUE(SendAll(cfd, &MakeFrame(UDPS_TYPE_CONFIG, 0u, MakeConfigPayload())[0],
UDPS_HEADER_SIZE + 4u + UDPS_SIGNAL_DESC_SIZE + 1u));
void *mem = NULL_PTR(void *);
ASSERT_TRUE(ds->GetSignalMemoryBuffer(0u, 0u, mem));
/* Synchronise() only sees a Post that lands while it waits, so keep feeding. */
uint32 got = 0u;
for (uint32 n = 0u; (n < 300u) && (got != 4242u); n++) {
std::vector<uint8> fr = MakeFrame(UDPS_TYPE_DATA, n + 1u, MakeDataPayload(4242u));
ASSERT_TRUE(SendAll(cfd, &fr[0], fr.size()));
(void)ds->Synchronise();
memcpy(&got, mem, sizeof(got));
}
EXPECT_EQ(4242u, got);
EXPECT_TRUE(ds->IsConnected());
EXPECT_EQ(1u, ds->GetConnectionCount());
EXPECT_EQ(0u, ds->GetProtocolErrors());
/* Server goes away: the client must notice and reconnect by itself. */
close(cfd);
int cfd2 = AcceptOne(lfd, 5000);
EXPECT_GE(cfd2, 0);
EXPECT_EQ(2u, ds->GetConnectionCount());
if (cfd2 >= 0) {
close(cfd2);
}
close(lfd);
}
TEST(TCPStreamerGTest, ClientCountsProtocolErrorsAndReconnects) {
AppGuard guard;
uint16 port = 0u;
int lfd = Listen(port);
ASSERT_GE(lfd, 0);
std::string extra = "Port = " + PortStr(port) + " ReconnectDelay = 0.1";
ReferenceT<RealTimeApplication> app = LoadApplication(BuildConfig(false, "", true, extra));
ASSERT_TRUE(app.IsValid());
ReferenceT<TCPStreamerClient> ds = ObjectRegistryDatabase::Instance()->Find("Test.Data.Client");
ASSERT_TRUE(ds.IsValid());
ASSERT_TRUE(app->PrepareNextState("State1") == ErrorManagement::NoError);
int cfd = AcceptOne(lfd, 3000);
ASSERT_GE(cfd, 0);
const uint8 garbage[UDPS_HEADER_SIZE] = { 0xDE, 0xAD, 0xBE, 0xEF };
ASSERT_TRUE(SendAll(cfd, garbage, sizeof(garbage)));
EXPECT_TRUE(PeerClosed(cfd, 3000));
close(cfd);
int cfd2 = AcceptOne(lfd, 5000);
EXPECT_GE(cfd2, 0);
EXPECT_EQ(1u, ds->GetProtocolErrors());
if (cfd2 >= 0) {
close(cfd2);
}
close(lfd);
}
/*---------------------------------------------------------------------------*/
/* Streamer -> Client */
/*---------------------------------------------------------------------------*/
TEST(TCPStreamerGTest, StreamerToClientRoundTrip) {
AppGuard guard;
ReferenceT<RealTimeApplication> app = LoadApplication(BuildConfig(
true, "Port = 44827", true, "Port = 44827 ReconnectDelay = 0.1"));
ASSERT_TRUE(app.IsValid());
ReferenceT<TCPStreamer> streamer = ObjectRegistryDatabase::Instance()->Find("Test.Data.Streamer");
ReferenceT<TCPStreamerClient> client = ObjectRegistryDatabase::Instance()->Find("Test.Data.Client");
ASSERT_TRUE(streamer.IsValid());
ASSERT_TRUE(client.IsValid());
ASSERT_TRUE(app->PrepareNextState("State1") == ErrorManagement::NoError);
void *mem = NULL_PTR(void *);
ASSERT_TRUE(client->GetSignalMemoryBuffer(0u, 0u, mem));
uint32 got = 0u;
for (uint32 n = 0u; (n < 600u) && (got != 777u); n++) {
SetCounter(streamer, 777u);
ASSERT_TRUE(streamer->Synchronise());
(void)client->Synchronise();
memcpy(&got, mem, sizeof(got));
}
EXPECT_EQ(777u, got);
EXPECT_TRUE(client->IsConnected());
EXPECT_EQ(1u, streamer->GetClientCount());
EXPECT_EQ(0u, client->GetProtocolErrors());
}
+195
View File
@@ -0,0 +1,195 @@
#ifndef TCP_TEST_UTIL_H_
#define TCP_TEST_UTIL_H_
/**
* @file TCPTestUtil.h
* @brief Raw-socket helpers shared by the TCPS* GTests (C++98, STL allowed).
*/
#include <arpa/inet.h>
#include <errno.h>
#include <netinet/in.h>
#include <poll.h>
#include <string.h>
#include <sys/socket.h>
#include <time.h>
#include <unistd.h>
#include <vector>
#include "CompilerTypes.h"
#include "UDPSProtocol.h"
namespace tcptest {
using namespace MARTe;
inline uint64 NowMs() {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return static_cast<uint64>(ts.tv_sec) * 1000u + static_cast<uint64>(ts.tv_nsec) / 1000000u;
}
/** Connect a blocking socket to 127.0.0.1:port. @return fd, or -1. */
inline int Connect(uint16 port, int rcvBuf = 0) {
int fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd < 0) {
return -1;
}
if (rcvBuf > 0) {
(void)setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvBuf, sizeof(rcvBuf));
}
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
if (connect(fd, reinterpret_cast<struct sockaddr *>(&addr), sizeof(addr)) != 0) {
close(fd);
return -1;
}
return fd;
}
/** Read exactly @p n bytes within @p timeoutMs. */
inline bool ReadExact(int fd, uint8 *dst, size_t n, int timeoutMs) {
const uint64 deadline = NowMs() + static_cast<uint64>(timeoutMs);
size_t got = 0u;
while (got < n) {
int64 left = static_cast<int64>(deadline) - static_cast<int64>(NowMs());
if (left < 0) {
return false;
}
struct pollfd p;
p.fd = fd;
p.events = POLLIN;
p.revents = 0;
int r = poll(&p, 1, static_cast<int>(left));
if (r <= 0) {
return false;
}
ssize_t k = recv(fd, dst + got, n - got, 0);
if (k <= 0) {
return false;
}
got += static_cast<size_t>(k);
}
return true;
}
struct Frame {
uint8 type;
uint32 counter;
uint16 fragmentIdx;
uint16 totalFragments;
std::vector<uint8> payload;
};
/** Read one UDPS frame. @return false on timeout, EOF or a bad header. */
inline bool ReadFrame(int fd, Frame &f, int timeoutMs) {
uint8 hb[UDPS_HEADER_SIZE];
if (!ReadExact(fd, hb, UDPS_HEADER_SIZE, timeoutMs)) {
return false;
}
UDPSPacketHeader h;
memcpy(&h, hb, UDPS_HEADER_SIZE);
if (h.magic != UDPS_MAGIC) {
return false;
}
f.type = h.type;
f.counter = h.counter;
f.fragmentIdx = h.fragmentIdx;
f.totalFragments = h.totalFragments;
f.payload.resize(h.payloadBytes);
if (h.payloadBytes > 0u) {
return ReadExact(fd, &f.payload[0], h.payloadBytes, timeoutMs);
}
return true;
}
/** @return true if the peer closed the connection within @p timeoutMs. */
inline bool PeerClosed(int fd, int timeoutMs) {
struct pollfd p;
p.fd = fd;
p.events = POLLIN;
p.revents = 0;
if (poll(&p, 1, timeoutMs) <= 0) {
return false;
}
uint8 b;
ssize_t k = recv(fd, &b, 1, MSG_DONTWAIT);
return (k == 0) || ((k < 0) && (errno != EAGAIN));
}
/** Deterministic payload pattern. */
inline std::vector<uint8> Pattern(uint32 n, uint8 seed) {
std::vector<uint8> v(n);
for (uint32 i = 0u; i < n; i++) {
v[i] = static_cast<uint8>(seed + i);
}
return v;
}
/** Listen on 127.0.0.1:@p port (0 = ephemeral). @return fd, or -1; @p port is updated. */
inline int Listen(uint16 &port) {
int fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd < 0) {
return -1;
}
int one = 1;
(void)setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
socklen_t len = sizeof(addr);
if ((bind(fd, reinterpret_cast<struct sockaddr *>(&addr), sizeof(addr)) != 0) ||
(listen(fd, 8) != 0) ||
(getsockname(fd, reinterpret_cast<struct sockaddr *>(&addr), &len) != 0)) {
close(fd);
return -1;
}
port = ntohs(addr.sin_port);
return fd;
}
/** Accept one connection within @p timeoutMs. @return fd, or -1. */
inline int AcceptOne(int listenFd, int timeoutMs) {
struct pollfd p;
p.fd = listenFd;
p.events = POLLIN;
p.revents = 0;
if (poll(&p, 1, timeoutMs) <= 0) {
return -1;
}
return accept(listenFd, NULL, NULL);
}
inline bool SendAll(int fd, const uint8 *data, size_t n) {
size_t sent = 0u;
while (sent < n) {
ssize_t k = send(fd, data + sent, n - sent, MSG_NOSIGNAL);
if (k <= 0) {
return false;
}
sent += static_cast<size_t>(k);
}
return true;
}
/** Build a complete UDPS frame (header + payload). */
inline std::vector<uint8> MakeFrame(uint8 type, uint32 counter, const std::vector<uint8> &payload,
uint16 totalFragments = 1u, uint16 fragmentIdx = 0u) {
std::vector<uint8> f(UDPS_HEADER_SIZE + payload.size());
UDPSBuildHeader(&f[0], type, counter, fragmentIdx, totalFragments, static_cast<uint32>(payload.size()));
if (!payload.empty()) {
memcpy(&f[UDPS_HEADER_SIZE], &payload[0], payload.size());
}
return f;
}
} // namespace tcptest
#endif // TCP_TEST_UTIL_H_
+701 -1
View File
@@ -195,6 +195,704 @@
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h
../../Build/x86-linux//GTest/TCPSClientGTest.o: TCPSClientGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/Interfaces/UDPStream/TCPSServer.h TCPTestUtil.h
../../Build/x86-linux//GTest/TCPSServerGTest.o: TCPSServerGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
../../Source/Components/Interfaces/UDPStream/TCPSServer.h \
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
TCPTestUtil.h
../../Build/x86-linux//GTest/TCPStreamerGTest.o: TCPStreamerGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/ExecutableI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSMETHODREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodInterfaceMapper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodCaller.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodCallerT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAMSchedulerI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/TimingDataSource.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAMDataSource.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryArea.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/Message.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageFilterPool.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplicationConfigurationBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/RegisteredMethodsMessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/StandardParser.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationParserI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyTypeCreator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/LexicalAnalyzer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/GrammarInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/Token.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TokenInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ParserI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/RuntimeEvaluator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticStack.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/VariableInformation.h \
../../Source/Components/DataSources/TCPStreamer/TCPStreamer.h \
../../Source/Components/Interfaces/UDPStream/TCPSServer.h \
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/Interfaces/TCPStreamService/TCPSServiceStream.h \
../../Source/Components/Interfaces/TCPStreamService/TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
../../Source/Components/Interfaces/UDPStream/UDPSServer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../Source/Components/DataSources/TCPStreamerClient/TCPStreamerClient.h \
../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
../../Source/Components/DataSources/UDPStreamerClient/UDPStreamerClient.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h TCPTestUtil.h
../../Build/x86-linux//GTest/TCPStreamServiceGTest.o: TCPStreamServiceGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/ExecutableI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSMETHODREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodInterfaceMapper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodCaller.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodCallerT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAMSchedulerI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/TimingDataSource.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAMDataSource.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryArea.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/Message.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageFilterPool.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplicationConfigurationBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/RegisteredMethodsMessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/StandardParser.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationParserI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyTypeCreator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/LexicalAnalyzer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/GrammarInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/Token.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TokenInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ParserI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/RuntimeEvaluator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticStack.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/VariableInformation.h \
../../Source/Components/Interfaces/TCPStreamService/TCPSServiceStream.h \
../../Source/Components/Interfaces/TCPStreamService/TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/Interfaces/TCPStreamService/TCPStreamService.h \
../../Source/Components/DataSources/TCPStreamer/TCPStreamer.h \
../../Source/Components/Interfaces/UDPStream/TCPSServer.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
../../Source/Components/Interfaces/UDPStream/UDPSServer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../Source/Components/DataSources/TCPStreamerClient/TCPStreamerClient.h \
../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
../../Source/Components/DataSources/UDPStreamerClient/UDPStreamerClient.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h TCPTestUtil.h
../../Build/x86-linux//GTest/UDPSClientGTest.o: UDPSClientGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
@@ -342,4 +1040,6 @@
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../Common/UDP/UDPSProtocol.h
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/Interfaces/UDPStream/UDPSServer.h
+701 -1
View File
@@ -195,6 +195,704 @@ MainGTest.o: MainGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h
TCPSClientGTest.o: TCPSClientGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/Interfaces/UDPStream/TCPSServer.h TCPTestUtil.h
TCPSServerGTest.o: TCPSServerGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
../../Source/Components/Interfaces/UDPStream/TCPSServer.h \
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
TCPTestUtil.h
TCPStreamerGTest.o: TCPStreamerGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/ExecutableI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSMETHODREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodInterfaceMapper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodCaller.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodCallerT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAMSchedulerI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/TimingDataSource.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAMDataSource.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryArea.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/Message.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageFilterPool.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplicationConfigurationBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/RegisteredMethodsMessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/StandardParser.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationParserI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyTypeCreator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/LexicalAnalyzer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/GrammarInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/Token.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TokenInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ParserI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/RuntimeEvaluator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticStack.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/VariableInformation.h \
../../Source/Components/DataSources/TCPStreamer/TCPStreamer.h \
../../Source/Components/Interfaces/UDPStream/TCPSServer.h \
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/Interfaces/TCPStreamService/TCPSServiceStream.h \
../../Source/Components/Interfaces/TCPStreamService/TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
../../Source/Components/Interfaces/UDPStream/UDPSServer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../Source/Components/DataSources/TCPStreamerClient/TCPStreamerClient.h \
../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
../../Source/Components/DataSources/UDPStreamerClient/UDPStreamerClient.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h TCPTestUtil.h
TCPStreamServiceGTest.o: TCPStreamServiceGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/ExecutableI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSMETHODREGISTER.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodInterfaceMapper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodCaller.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassMethodCallerT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAMSchedulerI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ProcessorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitSet.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/TimingDataSource.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAMDataSource.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryArea.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/Message.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageFilterPool.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/MessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplicationConfigurationBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/RealTimeApplication.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages/RegisteredMethodsMessageFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/StandardParser.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationParserI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyTypeCreator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/LexicalAnalyzer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/GrammarInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/Token.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TokenInfo.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ParserI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/RuntimeEvaluator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticStack.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/VariableInformation.h \
../../Source/Components/Interfaces/TCPStreamService/TCPSServiceStream.h \
../../Source/Components/Interfaces/TCPStreamService/TCPStreamService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/Threads.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ThreadsB.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/ExceptionHandler.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/ExecutionInfo.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/SingleThreadService.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/Interfaces/TCPStreamService/TCPStreamService.h \
../../Source/Components/DataSources/TCPStreamer/TCPStreamer.h \
../../Source/Components/Interfaces/UDPStream/TCPSServer.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/DataSources/UDPStreamer/UDPStreamer.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability/EventSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/MemoryDataSourceI.h \
../../Source/Components/Interfaces/UDPStream/UDPSServer.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicTCPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetHostCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/InternetMulticastCore.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HandleI.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/Environment/Linux/SocketCore.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/BasicUDPSocket.h \
/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability/InternetHost.h \
../../Source/Components/DataSources/TCPStreamerClient/TCPStreamerClient.h \
../../Source/Components/Interfaces/UDPStream/TCPSClient.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
../../Source/Components/DataSources/UDPStreamerClient/UDPStreamerClient.h \
../../Source/Components/Interfaces/UDPStream/UDPSClient.h TCPTestUtil.h
UDPSClientGTest.o: UDPSClientGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
@@ -342,4 +1040,6 @@ UDPSClientGTest.o: UDPSClientGTest.cpp \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedServiceMethodBinderT.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThreadI.h \
/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services/EmbeddedThread.h \
../../Common/UDP/UDPSProtocol.h
../../Common/UDP/UDPSProtocol.h \
../../Source/Components/Interfaces/UDPStream/UDPSTransportI.h \
../../Source/Components/Interfaces/UDPStream/UDPSServer.h
@@ -0,0 +1,114 @@
# TCPStreamer / TCPStreamerClient Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Add `TCPStreamer` (output) and `TCPStreamerClient` (input) MARTe2 DataSources that carry the existing UDPS framing over TCP, reusing `UDPStreamer`/`UDPStreamerClient` by making their transport pluggable.
**Architecture:** Two abstract interfaces (`UDPSServerI`, `UDPSClientI`) wrap the seven server calls and four client calls the datasources already use. The base datasources own the transport through a heap pointer that a subclass can swap (`SetServer`/`SetClient`) and expose two virtual hooks (`DefaultMaxPayloadSize`, `InitialiseTransport`). `TCPStreamer : UDPStreamer` and `TCPStreamerClient : UDPStreamerClient` plug in the new `TCPSServer` / `TCPSClient`.
**Tech Stack:** C++ (MARTe2 conventions, no STL in `Source/`), POSIX sockets, GTest (STL allowed in tests), MARTe2 make system.
Spec: `docs/superpowers/specs/2026-11-05-tcp-streamer-design.md`.
## Global Constraints
- No STL, no OS mutexes in `Source/Components/` (spec: "No STL, no OS mutexes; allocation only in `Start()`" — relaxed to "never on the RT thread"; slots grow lazily on the sender thread).
- Wire format unchanged: UDPS 17-byte header + CONFIG/DATA payload, `totalFragments` always 1.
- RT path (`Synchronise()`) must stay "spinlock + memcpy".
- Config keys: `Port` (44500), `MaxPayloadSize` (60000), `MaxClients` (16), `ClientQueueDepth` (8), `ClientStallTimeout` (5 s, 0 disables); client: `ServerAddress`, `Port`, `SilenceTimeout`, `ReconnectDelay`, `CPUMask`, `StackSize`.
- `TCPStreamer` rejects `MulticastGroup`, `Interface`, `DataPort`; `TCPStreamerClient` rejects the same.
- Do not `git add` unrelated working-tree changes (`Client/debugger/go.*`, `run_*.sh`, `Common/Client/c/Makefile`, ...). Add files by name. Commit only when the user asks.
- Build: `source env.sh`, then `make -f Makefile.gcc core test`. Run from repo root. `make clean` first in Task 1 (class layouts change; `Interfaces/UDPStream` has no depends file).
## File Structure
| File | Responsibility |
|---|---|
| `Source/Components/Interfaces/UDPStream/UDPSTransportI.h` (new) | `UDPSServerI`, `UDPSClientI` |
| `.../UDPStream/UDPSServer.h`, `UDPSClient.h` (modify) | implement the interfaces |
| `.../UDPStream/TCPSServer.{h,cpp}` (new) | multi-client non-blocking TCP server, per-client bounded queue |
| `.../UDPStream/TCPSClient.{h,cpp}` (new) | reconnecting TCP frame reader on its own thread |
| `.../UDPStream/Makefile.inc` (modify) | add `TCPSServer.x TCPSClient.x` |
| `Source/Components/DataSources/UDPStreamer/UDPStreamer.{h,cpp}` (modify) | transport via `UDPSServerI*`, hooks |
| `Source/Components/DataSources/UDPStreamerClient/UDPStreamerClient.{h,cpp}` (modify) | transport via `UDPSClientI*`, hooks |
| `Source/Components/DataSources/TCPStreamer/` (new) | `TCPStreamer`, Makefiles |
| `Source/Components/DataSources/TCPStreamerClient/` (new) | `TCPStreamerClient`, Makefiles |
| `Makefile.gcc` (modify) | build/clean the two new components |
| `Test/GTest/TCPTestUtil.h` (new) | raw-socket helpers shared by the new tests |
| `Test/GTest/TCPSServerGTest.cpp`, `TCPSClientGTest.cpp`, `TCPStreamerGTest.cpp` (new) | tests |
| `Test/GTest/Makefile.inc` (modify) | register tests, include paths |
| `Docs/TCPStreamer.md`, `CLAUDE.md`, spec (modify/new) | docs |
---
### Task 1: Pluggable transport seam (pure refactor, UDP behaviour unchanged)
**Files:** create `UDPSTransportI.h`; modify `UDPSServer.h`, `UDPSClient.h`, `UDPStreamer.{h,cpp}`, `UDPStreamerClient.{h,cpp}`.
**Interfaces:**
- Produces:
```cpp
class UDPSServerI { virtual ~UDPSServerI(){}
virtual bool Initialise(StructuredDataI&)=0; virtual bool Start()=0; virtual bool Stop()=0;
virtual void ServiceClients()=0; virtual bool SendConfig(const uint8*,uint32)=0;
virtual bool SendData(uint32 counter,const uint8*,uint32)=0;
virtual bool HasClients() const=0; virtual bool IsMulticast() const=0; virtual uint16 GetPort() const=0; };
class UDPSClientI { virtual ~UDPSClientI(){}
virtual bool Initialise(StructuredDataI&)=0; virtual void SetListener(UDPSClientListener*)=0;
virtual bool Start()=0; virtual bool Stop()=0; };
```
`UDPStreamer` protected: `virtual uint32 DefaultMaxPayloadSize() const`, `virtual bool InitialiseTransport(StructuredDataI&)`, `void SetServer(UDPSServerI*)`, `UDPSServerI *Transport() const`.
`UDPStreamerClient` protected: `virtual bool InitialiseTransport(StructuredDataI&)`, `void SetClient(UDPSClientI*)`, members `serverAddress, port, silenceTimeout, cpuMask, stackSize`.
- [ ] **Step 1: Baseline.** `make -f Makefile.gcc clean && make -f Makefile.gcc core test`, then run `./Build/x86-linux/GTest/MainGTest.ex` and record pass/fail counts.
- [ ] **Step 2:** Create `UDPSTransportI.h` (code above; forward-declare `class UDPSClientListener;`).
- [ ] **Step 3:** `UDPSServer.h`: `#include "UDPSTransportI.h"`, `class UDPSServer : public UDPSServerI`. `UDPSClient.h`: `class UDPSClient : public UDPSClientI, public EmbeddedServiceMethodBinderI`. Signatures already match; no `override` keyword (MARTe2 style).
- [ ] **Step 4:** `UDPStreamer`: replace `UDPSServer server;` by `UDPSServerI *server;` (private), constructor `server = new UDPSServer();`, destructor stops then deletes it after the executor is stopped, `server.X` -> `server->X` everywhere, `maxPayloadSize = DefaultMaxPayloadSize()` in `Initialise`, move the `serverCfg` block into `UDPStreamer::InitialiseTransport` (default impl, identical code, calling `server->Initialise`). `GetPort()` keeps returning the member.
- [ ] **Step 5:** `UDPStreamerClient`: same pattern with `UDPSClientI *client`; move the "Forward the transport parameters" block into `InitialiseTransport`; destructor `client->Stop()` when `receiverUp`, then delete.
- [ ] **Step 6:** `make clean && make core test`; run `MainGTest.ex`: counts must equal Step 1. Run `./Build/x86-linux/Test/Integration/Integration/IntegrationTests.ex` if it passed at baseline.
### Task 2: `TCPSServer`
**Files:** create `TCPSServer.{h,cpp}`, `Test/GTest/TCPTestUtil.h`, `Test/GTest/TCPSServerGTest.cpp`; modify `UDPStream/Makefile.inc`, `Test/GTest/Makefile.inc`.
**Design (see code for the authoritative version):**
- Raw POSIX sockets. Listener non-blocking, `SO_REUSEADDR`; `Port=0` binds an ephemeral port and `GetPort()` returns the bound port after `Start()`.
- Per client: `Slot[ClientQueueDepth+2]` queue (`buf, cap, len, isConfig`), `frontSent` (bytes of the front frame already written), `dataQueued`, `lastProgressTicks`.
- Queue capacity `depth+2` is exact: at most one data-in-flight/old frame, plus two CONFIG frames, plus `depth` DATA frames.
- `QueueConfig`: drop every queued frame except an in-flight one, append the CONFIG (CONFIG never dropped, never behind stale DATA).
- `QueueData`: while `dataQueued >= depth`, remove the oldest non-in-flight DATA (count a drop); if none is removable drop the new frame.
- `Flush`: `send(MSG_NOSIGNAL|MSG_DONTWAIT)` loop; `EAGAIN` stops; other errors evict.
- `ServiceClients`: accept (non-blocking), refuse beyond `MaxClients`, enqueue cached CONFIG on accept, detect peer close with `recv`, flush, evict clients with no progress for `ClientStallTimeout`, rate-limited (1/s) drop report.
- Extra key `SendBufferSize` (0 = OS default): `SO_SNDBUF` on accepted sockets, which also bounds latency and makes slow-client tests deterministic.
- `SendData` returns true unless the frame exceeds 1 MiB; per-client drops are reported through `GetClientDrops()`.
- [ ] **Step 1:** write `TCPSServerGTest.cpp` first: `Initialise` rejects (`MaxPayloadSize=0`, `ClientQueueDepth=0`, `MaxClients=0`), `ConfigBeforeData_LateJoin`, `MultipleClients_InOrder`, `ReconfigDeliveredToConnectedClient`, `MaxClientsRefused`, `PeerCloseEvicts`, `SlowClientDropsFastClientComplete` (200 x 60000-byte frames, `SendBufferSize=65536`, slow client `SO_RCVBUF=4096` never reads, fast client thread receives all counters 1..200 in order, `GetClientDrops() > 0`), `StallDisconnect` (`ClientStallTimeout=1`).
- [ ] **Step 2:** run -> compile failure (no `TCPSServer.h`).
- [ ] **Step 3:** implement `TCPSServer`; add to `OBJSX`.
- [ ] **Step 4:** `make -f Makefile.gcc core test && ./Build/x86-linux/GTest/MainGTest.ex --gtest_filter='TCPSServer*'` -> all pass.
### Task 3: `TCPSClient`
**Files:** create `TCPSClient.{h,cpp}`, `Test/GTest/TCPSClientGTest.cpp`; modify `UDPStream/Makefile.inc`, `Test/GTest/Makefile.inc` (already shared).
**Design:** `TCPSClient : UDPSClientI, EmbeddedServiceMethodBinderI`; `SingleThreadService`; `Execute` per iteration: if disconnected honour `ReconnectDelay`, then non-blocking `connect` + `poll` (bounded 500 ms) -> `OnUDPSConnected`; if connected `poll(50 ms)`, `recv` into a `HEADER+1 MiB` buffer, parse complete frames, bad magic / `payloadBytes > 1 MiB` / `totalFragments != 1` -> close + `OnUDPSDisconnected`; peer close/read error/`SilenceTimeout` the same. Keys: `ServerAddr`, `Port`, `SilenceTimeout` (float32 s, default 0 = off), `ReconnectDelay` (float32 s, default 2), `CPUMask`, `StackSize`. `Stop()` closes silently (no callbacks).
- [ ] **Step 1:** tests (`RecordingListener` with `std::mutex`): `ReceivesConfigThenData` (real `TCPSServer`), `ReconnectAfterServerRestart` (fixed port, `ReconnectDelay=0.2`), `RejectsBadMagic`, `RejectsOversizeLength`, `PartialFrameReads` (raw server writing a frame in 3 chunks), `SilenceTimeoutReconnects`, `StopIsPrompt`.
- [ ] **Step 2:** run -> compile failure. **Step 3:** implement. **Step 4:** `--gtest_filter='TCPSClient*'` passes.
### Task 4: `TCPStreamer`, `TCPStreamerClient`, build wiring
**Files:** create `Source/Components/DataSources/TCPStreamer/{TCPStreamer.h,TCPStreamer.cpp,Makefile.gcc,Makefile.inc}`, same for `TCPStreamerClient`, `Test/GTest/TCPStreamerGTest.cpp`; modify root `Makefile.gcc`, `Test/GTest/Makefile.inc`.
- [ ] **Step 1:** `TCPStreamerGTest.cpp`: `Constructor_Defaults` (`GetMaxPayloadSize()==60000`, `GetPort()==44500`), `Initialise_RejectsUdpOnlyKeys` (both classes), `Initialise_TcpKeys`, `ClassRegistered`, `StreamerToRawClient` (RealTimeApplication with `TCPStreamer`, raw client sees CONFIG then DATA while the test calls `Synchronise()`), `RoundTripStreamerToClient` (`TCPSServer`-driven client DS: send CONFIG+DATA, `Synchronise()` on a helper thread, check decoded value).
- [ ] **Step 2:** run -> compile failure. **Step 3:** implement both classes (each overrides `Initialise` to reject keys, `DefaultMaxPayloadSize`/`InitialiseTransport`, constructor swaps in the TCP transport). Makefile.inc copies UDPStreamer's, with `-lUDPStreamer -lUDPStream` (client: `-lUDPStreamerClient`), packages `Components/DataSources`.
- [ ] **Step 4:** add to root `Makefile.gcc` `core` and `clean`; if the `MainGTest` link reports undefined `UDPStreamer` symbols wrap `LIBRARIES_STATIC` in `-Wl,--start-group ... -Wl,--end-group`.
- [ ] **Step 5:** full `make core test`, whole `MainGTest.ex` and UDP datasource tests pass.
### Task 5: Docs and spec sync
- [ ] `Docs/TCPStreamer.md` (config tables, behaviour, service feasibility pointer), `CLAUDE.md` one-line mention, and update the spec for decisions taken while building: lazy slot growth, `SendBufferSize`, `GetPort()` returns the bound port, `SendData` true unless oversize, client `SilenceTimeout` default 0, no client-side gap handling, Strict frames may exceed `MaxPayloadSize` up to 1 MiB.
## Self-review
Spec coverage: pluggable transport (T1), `TCPSServer` incl. CONFIG-first, drop, stall (T2), `TCPSClient` (T3), both datasources + rejection of UDP-only keys + tests + regression (T4), docs/service study already in spec section 7 (T5). Naming checked: `UDPSServerI`, `UDPSClientI`, `SetServer`, `SetClient`, `Transport()`, `DefaultMaxPayloadSize`, `InitialiseTransport` are used identically across tasks.
@@ -0,0 +1,249 @@
# TCPStreamer / TCPStreamerClient — design
Date: 2026-11-05
## Goal
A pair of MARTe2 DataSources, `TCPStreamer` (output) and `TCPStreamerClient`
(input), equivalent to `UDPStreamer` / `UDPStreamerClient` but carrying data
over TCP. Plus a feasibility study (section 7) of a single in-process service
that streams data from several DataSources over multiple threads.
## Decisions (agreed)
1. **Wire format**: the existing UDPS framing (17-byte header + CONFIG/DATA
payload) over the TCP byte stream, `totalFragments` always 1. No new
protocol; no fragmentation or reassembly.
2. **Slow consumers**: drop for the slow client only. Bounded per-client queue
(`ClientQueueDepth` frames); a client whose queue is full loses frames
(counted per client, logged at most once per second); a client stalled
longer than `ClientStallTimeout` is disconnected. Other clients and the RT
thread are never affected.
3. **Service**: an in-process MARTe2 `Interface` object (like `DebugService`),
not a separate daemon. Investigated here, not built in v1.
Decisions made without asking (flagged, easy to reverse):
- v1 scope is the two DataSources plus their transport classes. Consumers
other than `TCPStreamerClient` (StreamHub, Go decoder, C client, UDPScope)
keep speaking UDP; adding a TCP ingest to them is a follow-up that needs no
protocol change because of decision 1.
- The service is a design study only (section 7). v1 is built so the service
can later reuse the same transport classes.
## 1. Architecture: pluggable transport, shared serialisation
`UDPStreamer` already isolates its transport behind seven calls on `UDPSServer`
(`Initialise`, `Start`, `Stop`, `ServiceClients`, `HasClients`, `SendConfig`,
`SendData`); `UDPStreamerClient` uses `UDPSClient` through four
(`Initialise`, `SetListener`, `Start`, `Stop`). Everything else in those files
(signal parsing, quantisation, Strict/Accumulate/Decimate, double buffering,
drop accounting, DATA decode) is transport-independent and ~1000 lines.
Forking the files would duplicate that. Instead:
- Add two small abstract interfaces next to the existing classes in
`Source/Components/Interfaces/UDPStream/`:
- `UDPSServerI` — the seven server calls above.
- `UDPSClientI` — the four client calls above.
- `UDPSServer` / `UDPSClient` implement them (signature-only change; behaviour
untouched).
- `UDPStreamer` / `UDPStreamerClient` hold a pointer to the interface, created
by a protected virtual factory (`CreateServer()` / `CreateClient()`) that
defaults to the UDP implementation.
- `TCPStreamer : UDPStreamer` and `TCPStreamerClient : UDPStreamerClient`
override the factory, register as their own MARTe2 classes, and override
`Initialise` only to parse the TCP-specific keys and reject the UDP-only ones.
- New transport classes `TCPSServer` and `TCPSClient` in the same
`Interfaces/UDPStream` library.
Risk: this touches working RT code. Mitigation: the change to the UDP classes
is mechanical (pointer instead of member), and the existing GTests and the
E2E suite cover them; run both before and after.
## 2. TCPSServer
Single-threaded, driven from the owner's `Execute()` loop exactly like
`UDPSServer`; no thread per client.
- Listening socket, `SO_REUSEADDR`, non-blocking accept in `ServiceClients()`.
- Per client: non-blocking socket, `TCP_NODELAY`, ring of `ClientQueueDepth`
frames (pre-allocated at `Start()`, each sized `UDPS_HEADER_SIZE +
MaxPayloadSize`), partial-write cursor, drop counter, last-progress
timestamp.
- On accept: enqueue the cached CONFIG first, so a client always sees CONFIG
before any DATA. `SendConfig()` while clients are connected enqueues the new
CONFIG on every client (same as UDP) and refreshes the cache.
- CONFIG never goes through the DATA ring: each client has a separate
pending-CONFIG slot that is always flushed before any queued DATA, so
CONFIG can't be dropped and a CONFIG change can't be reordered behind
stale DATA.
- `SendData()`: builds one frame, copies it into each client's DATA ring
(when full, the oldest queued DATA frame is discarded and counted, so a
recovering client resumes near live), then attempts a non-blocking flush
on each client. `ServiceClients()` also flushes, so a client that
became writable drains without waiting for the next DATA.
- Stall: no bytes written for `ClientStallTimeout` while the queue is
non-empty → close and evict. Peer close / error on write → evict.
- `Stop()` closes everything and frees buffers.
- No STL, no OS mutexes; allocation only in `Start()`.
Config keys (read by `TCPSServer::Initialise` from the datasource node):
| Key | Default | Meaning |
|---|---|---|
| `Port` | 44500 | TCP listen port |
| `MaxPayloadSize` | 60000 | Max payload bytes per frame; also bounds Accumulate batches |
| `MaxClients` | 16 | Simultaneous clients; extra connections refused |
| `ClientQueueDepth` | 8 | Frames queued per client before dropping |
| `ClientStallTimeout` | 5 | Seconds without progress before disconnect; 0 disables |
`MaxPayloadSize` keeps its UDP meaning only in that Accumulate sizes batches
from it; with no MTU to respect the default is raised, capped at
`UDPS_CLIENT_MAX_PACKET_BYTES` (1 MiB).
## 3. TCPStreamer
Same signal and publishing configuration as `UDPStreamer` (`PublishingMode`,
`MinRefreshRate`, `MaxBatchSize`, per-signal `Unit`/`Range*`/`QuantizedType`/
`TimeMode`/`TimeSignal`/`SamplingRate`, `CPUMask`, `StackSize`). Rejected as
invalid: `MulticastGroup`, `Interface`, `DataPort`. Class name `TCPStreamer`.
The CONFIG payload, including the `hrtFrequency` trailer, is unchanged.
Accessors (`GetPort`, `IsClientConnected`, `GetDroppedPublications`) are
inherited; add `GetClientDrops()` for the per-client queue drops.
## 4. TCPSClient and TCPStreamerClient
`TCPSClient` implements `UDPSClientI` and delivers via the existing
`UDPSClientListener` (`OnUDPSConfig`, `OnUDPSData`, `OnUDPSConnected`,
`OnUDPSDisconnected`), so `UDPStreamerClient`'s decode path is reused as is.
- Own thread (`SingleThreadService`). Connect with a bounded timeout; on
success `OnUDPSConnected`.
- Frame reader: read the 17-byte header, check magic and
`payloadBytes <= UDPS_CLIENT_MAX_PACKET_BYTES`, read the payload, dispatch
by type. Reads are non-blocking with a short `poll`, so `Stop()` is prompt
and a partial frame survives across iterations.
- Bad magic or oversize length → close and reconnect (stream is
unrecoverable once out of sync).
- Peer close, read error, or `SilenceTimeout` with no bytes → close,
`OnUDPSDisconnected`, retry after `ReconnectDelay`.
- No CONNECT/ACK/keepalive traffic: the connection itself is the session, and
the server sends CONFIG on accept.
- Gaps: TCP is lossless but `TCPSServer` may drop frames; `GetLastDataGap()`
is computed from the `counter` field exactly as for UDP, so timestamp
reconstruction keeps working. Stale-packet gating is a no-op (ordered
stream).
Keys: `ServerAddress` (default `127.0.0.1`), `Port`, `SilenceTimeout`,
`ReconnectDelay`, `CPUMask`, `StackSize`. `TCPStreamerClient` rejects the
multicast keys.
## 5. Error handling
- RT thread path unchanged: spinlock + memcpy in `Synchronise()`, nothing
network-related.
- All socket failures are per client; a failing client never fails
`SendData()` for the others, and `SendData()` returns true when at least
one client accepted the frame or none are connected.
- Drops and stalls are counted and reported rate-limited (1/s), like
`ReportDroppedPublications`.
## 6. Testing
- GTest for `TCPSServer` + `TCPSClient` over loopback: CONFIG-before-DATA on
late join; multiple clients; slow client drops while a fast one receives all
frames; stall disconnect; reconnect after server restart; garbage/oversize
frame rejection; partial-frame reads.
- Datasource tests under `Test/Components/DataSources/TCPStreamer{,Client}`
mirroring the UDP ones (Strict, Accumulate, Decimate, quantised signals,
round trip streamer → client).
- Regression: existing UDP GTests and the E2E suite before and after the
interface refactor.
- E2E scenario with a TCP chain is deferred with the consumer-side follow-up.
## 7. Single service, many DataSources, many threads (implemented as `TCPStreamService`; feasibility notes below)
**Verdict: feasible, moderate effort, and the v1 design is the right
stepping stone.**
Shape: `TCPStreamService` as a MARTe2 `Interface` singleton (registered like
`DebugService`). Config declares the port and the worker count. `TCPStreamer`
instances gain `Service = <name>` and, instead of owning a `TCPSServer`, call
`service->Publish(streamId, frame)` and `service->PublishConfig(...)`.
Threading:
- One accept thread. N worker threads (config `Workers`), each owning a shard
of client connections and running the same flush loop as `TCPSServer`
(poll-driven, non-blocking). Clients are assigned least-loaded at accept.
- Producers (the per-DataSource sender threads from `UDPStreamer::Execute`, not
the RT threads) publish into a per-stream buffer. Each worker reads those
buffers; handoff by a per-stream `FastPollingMutexSem`-guarded latest-frame
slot plus a monotonically increasing sequence number, so a worker that falls
behind skips to the newest frame rather than queueing — consistent with the
drop policy. This keeps RT paths free of cross-thread contention beyond what
exists today.
- Per-client queues stay private to the owning worker, so no locking on the
send path.
Protocol gap: the UDPS header has no stream identifier. Two ways to carry
several DataSources on one connection:
1. **One port per stream** — no protocol change, but then there is no
multiplexing and the service only saves threads.
2. **Add a stream id** — a new packet type `UDPS_TYPE_SUBSCRIBE`
(client → server, lists stream names) and a 2-byte stream-id prefix on
DATA/CONFIG payloads of multiplexed connections, negotiated by the
SUBSCRIBE exchange so legacy single-stream clients are unaffected. This is
a protocol change and must be mirrored across the C++, Go, C and JS
parsers (see `CLAUDE.md`).
Recommendation: build v1 now; if the service is wanted, do it as a separate
spec choosing option 2, reusing `TCPSServer`'s per-client queue/flush code as
the worker's inner loop. A separate-process daemon was considered and
rejected: it overlaps StreamHub, adds IPC to the RT path and a deployment
unit, with the only gain being survival across application restarts.
Open for that follow-up spec: stream naming and collision rules across
DataSources, per-stream vs per-client queue accounting, and whether
subscribe-time CONFIG filtering is needed.
## 8. As implemented (deviations from sections 2-6)
Decisions taken while building v1; where they differ from the text above,
this section wins.
- Per-client queue: `ClientQueueDepth + 2` slots (up to `depth` DATA, one
in-flight CONFIG, one pending CONFIG), grown lazily on the sender thread
rather than pre-allocated at `Start()`. A new CONFIG discards queued frames
that are not in flight (stale DATA) instead of being "flushed before DATA".
DATA with a full queue drops the oldest non-in-flight DATA frame, or the
incoming frame if only the in-flight one is queued.
- Extra key `SendBufferSize` (SO_SNDBUF for client sockets, 0 = OS default).
- `Port = 0` binds an ephemeral port; `TCPStreamer::GetBoundPort()` /
`TCPSServer::GetPort()` return the bound port once started.
- `SendData()` returns false only for frames larger than 1 MiB
(`TCPS_MAX_FRAME_PAYLOAD`). Frames may exceed `MaxPayloadSize`; it only
sizes Accumulate batches.
- Extra accessors: `GetClientCount()`, `GetClientDrops()` (uint64),
`GetStallEvictions()`.
- UDP-only keys rejected by `TCPStreamer`: `MulticastGroup`, `Interface`,
`DataPort`, `ClientTimeout`. By `TCPStreamerClient`: `MulticastGroup`,
`DataPort`, `Interface`, `KeepAliveInterval`.
- `TCPSClient` keys: `ServerAddr`, `Port`, `SilenceTimeout` (default 0 =
disabled, TCP reports dead peers itself), `ReconnectDelay` (default 2 s),
`CPUMask`, `StackSize`. `TCPStreamerClient` takes `ServerAddress` as the
UDP one does.
- No client-side gap or stale-packet handling: the client delivers frames
exactly as received. A bad magic, oversize length or fragmented frame drops
the connection and counts a protocol error.
- Tests: `Test/GTest/TCPSServerGTest.cpp`, `TCPSClientGTest.cpp`,
`TCPStreamerGTest.cpp` (shared helpers in `TCPTestUtil.h`), built into
`MainGTest.ex`. Not yet covered: Accumulate/Decimate/quantised signals over
TCP (serialisation is inherited unchanged from `UDPStreamer`), and the E2E
suite.
## 9. Known gap
- Default `MaxPayloadSize` (60000) is a first guess; confirm against
Accumulate batch latency during testing.
@@ -0,0 +1,86 @@
# TCPStreamService: joining streams (multiplex + merge)
Date: 2026-11-06. Extends `2026-11-05-tcp-streamer-design.md` section 7.
## Goal
Let one consumer take several service streams through a single, cheaper path.
Two independent mechanisms were requested ("both"):
1. **Multiplexed connection**: one TCP socket carries N streams, each keeping its
own CONFIG, rate and timeline.
2. **Merged stream**: the service builds one new stream whose CONFIG holds the
signals of several source streams, emitted at the pace of a master source
with sample-and-hold of the others.
## 1. Multiplexed connection
### Wire
- `SUBSCRIBE` (type 5) payload becomes a comma separated list of stream names
(`"fast,slow"`). One name is the old behaviour. Names may not contain `,`.
Limits: 64 names, 4096 payload bytes, no duplicates.
- The index of a stream is its position in the list.
- Every server-to-client frame carries the stream index in `fragmentIdx`
(`totalFragments` stays 1). Single-name connections always send 0, so
existing clients are unchanged.
- Any unknown name closes the whole connection (the client retries), exactly
like the single-name case.
### Server
- `TCPSConn` holds up to 64 stream attachments instead of one.
- A stream's frame is built once; `Push` copies it into each subscriber's queue
and stamps that connection's own index into `fragmentIdx`.
- `TCPSFrameQueue` accounts per stream: `ClientQueueDepth` DATA frames *per
stream*, drop-oldest of the same stream only, and a CONFIG only discards the
stale frames of its own stream. A fast stream can therefore never evict a
slow stream's frames.
- `Flush` batches queued frames into one `writev()` (up to 16 frames), which is
the optimisation for the many-small-frames case; it also applies to
single-stream connections.
- If a stream unregisters, every connection attached to it is closed.
### Client
- `TCPSClient` accepts `StreamName = "a,b,c"`. It demultiplexes by
`fragmentIdx` to one listener per stream and tracks the counter gap per
stream.
- `TCPSClient::GetStream(i)` returns a `UDPSClientI` facade for stream `i`.
Facades reference-count `Start()`/`Stop()` of the shared connection, so
existing consumers (StreamHub sessions) work unchanged.
- `TCPStreamer` / `TCPStreamerClient` DataSources are single-stream: a comma in
`StreamName` is rejected there.
### StreamHub
- A source with `Transport="tcp"` and `StreamName="a,b,c"` creates one session
per stream, all sharing one `TCPSClient`. Session labels are
`<Label>_<stream>` (just the stream name when no label is given).
## 2. Merged stream (`TCPStreamJoin`)
```
+Join = { Class = TCPStreamJoin Service = "Svc" StreamName = "all"
Sources = "fast,slow" Master = "fast" }
```
- Root-level object, like the service. It taps the source streams
(`TCPSStreamTapI`), and registers its own output stream with the service once
every source is registered. Losing a source unregisters the output.
- CONFIG: concatenated descriptors, names `<stream>_<signal>` (<= 63 chars),
`timeSignalIdx` rebased, publish mode Strict, common `hrtFrequency` (sources
with different frequencies are refused).
- DATA (one per master frame): `[master timestamp][source0 body][source1 body]...`
where a body is that source's last DATA payload without its 8-byte
timestamp. Nothing is emitted until every source has delivered one DATA.
- Only Strict and Decimate sources can be merged (Accumulate batches have
incompatible lengths) and a source body whose size changes without a CONFIG
change is ignored. Held values of a slower source are stamped with the
master's timestamp unless that source uses a time signal.
- Locking: join mutex, then the output stream mutex, then connection `qMutex`.
Notifications from the service happen outside its topology lock.
- No extra thread: the merged frame is built on the master producer's thread.
## Testing
- GTest: queue per-stream accounting + writev partial writes; service mux
(index tagging, fairness, unknown name, duplicate name, comma rejection);
client demux/gaps/facades; join (config merge, sample-and-hold, refusal
cases).
- E2E: a chain scenario with a multiplexed hub source (`tcp_service` + comma
list) and one with a merged stream.
+101 -181
View File
@@ -1,29 +1,35 @@
#!/usr/bin/env bash
# run_streamhub.sh — Launch a MARTe2 app with UDPStreamer + StreamHub
# run_debugtest.sh — Launch a small MARTe2 app under DebugService + the web debugger
#
# Usage:
# ./run_streamhub.sh [OPTIONS]
# ./run_debugtest.sh [OPTIONS]
#
# Options:
# -m <MARTe2_DIR> Override MARTe2 installation dir (default: $MARTe2_DIR)
# -c <MARTe2_Components_DIR> Override MARTe2-components dir (default: $MARTe2_Components_DIR)
# -b <BUILD_TARGET> Build target (default: x86-linux)
# -p <WS_PORT> StreamHub WebSocket port (default: 8090)
# -n <MAX_POINTS> StreamHub ring-buffer size per signal (default: 10000)
# -f <CFG> MARTe2 config (default: Test/Configurations/debug_test.cfg)
# -t <STATE> RealTimeState to start in (default: State1)
# -p <PORT> Debugger web UI port (default: 7777)
# -S Safe mode: do NOT allow FORCE/PAUSE/RESUME/STEP/BREAK
# from the browser (they are enabled by default here,
# since exercising them is the point of this script)
# -s Skip building — run with whatever is already built
# -g Launch the ImGui desktop client after start
# -w Build and launch the web UI server (Client/webui)
# -h Show this help
#
# What it runs:
# MARTeApp.ex with debug_test.cfg — three RT threads over a LinuxTimer:
# GAM1 (1 kHz counter/time), GAM2 (1 Hz + a ConstantGAM float),
# GAM3 (100-sample block), plus a +DebugService object.
# Client/debugger (Go) — serves the browser debugger; the page connects to the
# app's control port itself, so the app can be restarted underneath it.
#
# Ports used:
# 44500/udp UDPStreamer scalar signals (unicast control)
# 44503/udp UDPStreamer scalar signals (multicast data, group 239.0.0.1)
# 44501/udp UDPStreamer array signals (FirstSample / LastSample)
# 44502/udp UDPStreamer array signals (FullArray)
# 8080/tcp DebugService control
# 8081/udp DebugService stream
# 9090/tcp TCPLogger
# 8090/tcp StreamHub WebSocket (default, override with -p)
# 8080/tcp DebugService control (text commands)
# 8081/udp DebugService trace telemetry
# 8082/tcp TcpLogger (auto-injected by DebugService)
# 7777/tcp Debugger web UI (default, override with -p)
# The three DebugService ports come from the config file, not from this script.
#
# Environment:
# MARTe2_DIR must be set (or passed via -m)
@@ -32,28 +38,26 @@
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MARTe_CFG="${SCRIPT_DIR}/Test/Configurations/streamhub_demo.cfg"
BUILD_TARGET="${TARGET:-x86-linux}"
WS_PORT=8090
MAX_POINTS=1000000
MARTe_CFG="${SCRIPT_DIR}/Test/Configurations/debug_test.cfg"
MARTe_STATE="State1"
UI_PORT=7777
DANGEROUS=1
SKIP_BUILD=0
START_GUI=0
START_WEBUI=0
WEBUI_PORT=8080
# ── Parse arguments ───────────────────────────────────────────────────────────
while getopts "m:c:b:p:n:sgwh" opt; do
while getopts "m:c:b:f:t:p:Ssh" opt; do
case "$opt" in
m) MARTe2_DIR="$OPTARG" ;;
c) MARTe2_Components_DIR="$OPTARG" ;;
b) BUILD_TARGET="$OPTARG" ;;
p) WS_PORT="$OPTARG" ;;
n) MAX_POINTS="$OPTARG" ;;
f) MARTe_CFG="$OPTARG" ;;
t) MARTe_STATE="$OPTARG" ;;
p) UI_PORT="$OPTARG" ;;
S) DANGEROUS=0 ;;
s) SKIP_BUILD=1 ;;
g) START_GUI=1 ;;
w) START_WEBUI=1 ;;
h)
sed -n '2,30p' "$0" | grep '^#' | sed 's/^# \?//'
sed -n '2,40p' "$0" | grep '^#' | sed 's/^# \?//'
exit 0
;;
*) echo "Unknown option: -$OPTARG" >&2; exit 1 ;;
@@ -70,216 +74,132 @@ if [[ -z "${MARTe2_Components_DIR:-}" ]]; then
echo "ERROR: MARTe2_Components_DIR is not set. Source env.sh first or pass -c <dir>."
exit 1
fi
if [[ ! -f "$MARTe_CFG" ]]; then
echo "ERROR: MARTe2 config not found: ${MARTe_CFG}"
exit 1
fi
BUILD_DIR="${SCRIPT_DIR}/Build/${BUILD_TARGET}"
STREAMHUB_EX="${BUILD_DIR}/StreamHub/StreamHub.ex"
IMGUI_CLIENT="${SCRIPT_DIR}/Client/streamhub/build/StreamHubClient"
WEBUI_DIR="${SCRIPT_DIR}/Client/webui"
WEBUI_BIN="${WEBUI_DIR}/streamhub-webui"
COMP_DIR="${MARTe2_Components_DIR}/Build/${BUILD_TARGET}/Components"
DEBUGGER_DIR="${SCRIPT_DIR}/Client/debugger"
DEBUGGER_BIN="${DEBUGGER_DIR}/marte2debugger"
MARTE2_BIN="${MARTe2_DIR}/Build/${BUILD_TARGET}/App/MARTeApp.ex"
if [[ ! -x "$MARTE2_BIN" ]]; then
MARTE2_BIN="${MARTe2_DIR}/Build/${BUILD_TARGET}/App/MARTe2.sh"
fi
if [[ ! -x "$MARTE2_BIN" ]]; then
echo "ERROR: MARTe2 executable not found at ${MARTe2_DIR}/Build/${BUILD_TARGET}/App/"
echo "ERROR: MARTeApp.ex not found at ${MARTe2_DIR}/Build/${BUILD_TARGET}/App/"
exit 1
fi
# The DebugService ports live in the config, so read them back rather than
# printing numbers this script does not actually control.
cfg_port() {
grep -E "^[[:space:]]*$1[[:space:]]*=" "$MARTe_CFG" \
| head -1 | tr -d ' \t' | cut -d= -f2 || true
}
CTRL_PORT="$(cfg_port ControlPort)"; CTRL_PORT="${CTRL_PORT:-8080}"
UDP_PORT="$(cfg_port UdpPort)"; UDP_PORT="${UDP_PORT:-8081}"
LOG_PORT="$(cfg_port LogPort)"; LOG_PORT="${LOG_PORT:-8082}"
# ── Build ─────────────────────────────────────────────────────────────────────
if [[ "$SKIP_BUILD" -eq 0 ]]; then
echo "==> Building MARTe2 components (TARGET=${BUILD_TARGET})..."
make -C "${SCRIPT_DIR}" -f Makefile.gcc TARGET="${BUILD_TARGET}" 2>&1 | tail -10
make -C "${SCRIPT_DIR}" -f Makefile.gcc core TARGET="${BUILD_TARGET}" 2>&1 | tail -5
echo "==> Building StreamHub (TARGET=${BUILD_TARGET})..."
make -C "${SCRIPT_DIR}/Source/Applications/StreamHub" \
-f Makefile.gcc TARGET="${BUILD_TARGET}" \
MARTe2_DIR="${MARTe2_DIR}" 2>&1 | tail -10
if [[ "$START_GUI" -eq 1 ]]; then
if [[ -d "${SCRIPT_DIR}/Client/streamhub/build" ]]; then
echo "==> Building ImGui client (a full rebuild can take ~2 min;"
echo " ImPlot's implot_items.cpp is one slow -O3 translation unit)..."
cmake --build "${SCRIPT_DIR}/Client/streamhub/build" -j"$(nproc)"
fi
fi
if [[ "$START_WEBUI" -eq 1 ]]; then
echo "==> Building web UI server..."
(cd "${WEBUI_DIR}" && go build -o streamhub-webui .)
fi
echo "==> Building debugger client..."
(cd "${DEBUGGER_DIR}" && go build -o marte2debugger .)
echo "==> Build done."
fi
# ── Sanity-check binaries ─────────────────────────────────────────────────────
if [[ ! -x "$STREAMHUB_EX" ]]; then
echo "ERROR: StreamHub binary not found: ${STREAMHUB_EX}"
echo " Build it with: make -C Source/Applications/StreamHub -f Makefile.gcc"
if [[ ! -x "$DEBUGGER_BIN" ]]; then
echo "ERROR: debugger client not found: ${DEBUGGER_BIN}"
echo " Build it with: cd Client/debugger && go build -o marte2debugger ."
exit 1
fi
# ── Write StreamHub config ────────────────────────────────────────────────────
HUB_CFG="$(mktemp /tmp/streamhub_XXXXXX.cfg)"
cat > "$HUB_CFG" <<EOF
/**
* StreamHub configuration — auto-generated by run_streamhub.sh
*
* Three sources matching the streamhub_demo MARTe2 configuration:
* scalar : 1 kHz scalar sines @ 1 ksps (Sine1, Sine2)
* med : 1 kHz arrays @ 1 Msps (Ch1, Ch2)
* fast : 5 kHz arrays @ 5 Msps (Ch3, Ch4)
*/
Hub = {
WSPort = ${WS_PORT}
MaxPoints = ${MAX_POINTS}
PushRate = 30
MaxPushPoints = 2000
RingTemporal = 1000000
RingScalar = 100000
+History = {
Directory = "/tmp/streamhub_history"
DurationHours = 1
Decimation = 10
FlushIntervalSec = 5
MinDiskFreeMB = 200
}
+Recorder = {
Enabled = 0
AutoStart = 1
Directory = "/tmp/streamhub_rec"
MaxFileMB = 256
KeepFiles = 8
StagingMB = 8
FlushIntervalSec = 5
MinDiskFreeMB = 500
Signals = "all"
}
Sources = {
scalar = {
Label = "Scalar Sines (1 ksps)"
Addr = "127.0.0.1"
Port = 44500
MulticastGroup = "239.0.0.1"
DataPort = 44503
}
med = {
Label = "1 Msps Sines (Ch1 1kHz, Ch2 5kHz)"
Addr = "127.0.0.1"
Port = 44501
}
fast = {
Label = "5 Msps Sines (Ch3 10kHz, Ch4 50kHz)"
Addr = "127.0.0.1"
Port = 44502
}
}
}
EOF
# ── Library path — covers both MARTe2 app and StreamHub ──────────────────────
# ── Library path ──────────────────────────────────────────────────────────────
# DebugService pulls in TCPLogger and UDPStream; everything the config names
# beyond MARTe2 core (LinuxTimer, RealTimeThreadSynchronisation,
# LoggerDataSource, IOGAM, ConstantGAM) is dlopen'd from MARTe2-components.
export LD_LIBRARY_PATH="\
${MARTe2_DIR}/Build/${BUILD_TARGET}/Core:\
${MARTe2_Components_DIR}/Build/${BUILD_TARGET}/Components/DataSources/LinuxTimer:\
${MARTe2_Components_DIR}/Build/${BUILD_TARGET}/Components/GAMs/IOGAM:\
${BUILD_DIR}/Components/DataSources/UDPStreamer:\
${BUILD_DIR}/Components/GAMs/SineArrayGAM:\
${BUILD_DIR}/Components/GAMs/TimeArrayGAM:\
${BUILD_DIR}/Components/Interfaces/DebugService:\
${BUILD_DIR}/Components/Interfaces/TCPLogger:\
${BUILD_DIR}/Components/Interfaces/UDPStream:\
${COMP_DIR}/DataSources/LinuxTimer:\
${COMP_DIR}/DataSources/RealTimeThreadSynchronisation:\
${COMP_DIR}/DataSources/LoggerDataSource:\
${COMP_DIR}/GAMs/IOGAM:\
${COMP_DIR}/GAMs/ConstantGAM:\
${LD_LIBRARY_PATH:-}"
# ── Cleanup handler ───────────────────────────────────────────────────────────
MARTE_PID=""
HUB_PID=""
GUI_PID=""
WEBUI_PID=""
UI_PID=""
cleanup() {
echo ""
echo "==> Shutting down..."
[[ -n "$WEBUI_PID" ]] && kill "$WEBUI_PID" 2>/dev/null || true
[[ -n "$GUI_PID" ]] && kill "$GUI_PID" 2>/dev/null || true
[[ -n "$HUB_PID" ]] && kill "$HUB_PID" 2>/dev/null || true
[[ -n "$UI_PID" ]] && kill "$UI_PID" 2>/dev/null || true
[[ -n "$MARTE_PID" ]] && kill "$MARTE_PID" 2>/dev/null || true
wait "$WEBUI_PID" 2>/dev/null || true
wait "$GUI_PID" 2>/dev/null || true
wait "$HUB_PID" 2>/dev/null || true
wait "$UI_PID" 2>/dev/null || true
wait "$MARTE_PID" 2>/dev/null || true
rm -f "$HUB_CFG"
echo "==> Done."
}
trap cleanup EXIT INT TERM
# ── Launch MARTe2 ─────────────────────────────────────────────────────────────
echo ""
echo "==> Launching MARTe2..."
echo "==> Launching MARTe2 under DebugService..."
echo " Binary : ${MARTE2_BIN}"
echo " Config : ${MARTe_CFG}"
echo " Signals: Sine1 (1 Hz), Sine2 (0.3 Hz), Ch1-Ch4 (arrays)"
echo " State : ${MARTe_STATE}"
echo ""
"${MARTE2_BIN}" \
-l RealTimeLoader \
-f "${MARTe_CFG}" \
-s Running \
-m StateMachine:START &
-s "${MARTe_STATE}" &
MARTE_PID="$!"
# Give MARTe2 a moment to bind its UDP ports before StreamHub connects
# Give the app time to reach the state and bind the DebugService control port.
sleep 1
# ── Launch StreamHub ──────────────────────────────────────────────────────────
echo "==> Launching StreamHub..."
echo " Binary : ${STREAMHUB_EX}"
echo " Config : ${HUB_CFG}"
echo " WS port : ${WS_PORT}"
echo " MaxPoints: ${MAX_POINTS}"
echo ""
"${STREAMHUB_EX}" -cfg "${HUB_CFG}" &
HUB_PID="$!"
# ── Optionally launch the ImGui client ───────────────────────────────────────
if [[ "$START_GUI" -eq 1 ]]; then
if [[ ! -x "$IMGUI_CLIENT" ]]; then
echo "WARNING: ImGui client not found at ${IMGUI_CLIENT}"
echo " Build it with: cd Client/streamhub && cmake -B build && cmake --build build"
else
sleep 0.5
echo "==> Launching ImGui client (127.0.0.1:${WS_PORT})..."
"${IMGUI_CLIENT}" -host 127.0.0.1 -port "${WS_PORT}" &
GUI_PID="$!"
fi
if ! kill -0 "$MARTE_PID" 2>/dev/null; then
echo "ERROR: MARTe2 exited during startup — see the log above."
exit 1
fi
# ── Optionally launch the web UI server ──────────────────────────────────────
if [[ "$START_WEBUI" -eq 1 ]]; then
if [[ ! -x "$WEBUI_BIN" ]]; then
echo "WARNING: webui binary not found at ${WEBUI_BIN}"
echo " Build it with: cd Client/webui && go build -o streamhub-webui ."
else
echo "==> Launching web UI server (:${WEBUI_PORT})..."
"${WEBUI_BIN}" -addr ":${WEBUI_PORT}" \
-hub "localhost:${WS_PORT}" \
-static "${SCRIPT_DIR}/Client/udpstreamer/static" &
WEBUI_PID="$!"
fi
# ── Launch the debugger web client ────────────────────────────────────────────
echo "==> Launching debugger client (:${UI_PORT})..."
DANGEROUS_FLAG=()
if [[ "$DANGEROUS" -eq 1 ]]; then
DANGEROUS_FLAG=(-enable-dangerous-commands)
fi
"${DEBUGGER_BIN}" -addr ":${UI_PORT}" "${DANGEROUS_FLAG[@]}" &
UI_PID="$!"
sleep 0.5
# ── Status ────────────────────────────────────────────────────────────────────
echo ""
echo " MARTe2 PID : ${MARTE_PID}"
echo " StreamHub PID: ${HUB_PID}"
[[ -n "$GUI_PID" ]] && echo " ImGui PID : ${GUI_PID}"
[[ -n "$WEBUI_PID" ]] && echo " WebUI PID : ${WEBUI_PID}"
echo " Debugger PID : ${UI_PID}"
echo ""
echo " StreamHub WebSocket: ws://127.0.0.1:${WS_PORT}"
[[ -n "$WEBUI_PID" ]] && echo " Browser client : http://localhost:${WEBUI_PORT}/"
[[ -x "$IMGUI_CLIENT" ]] && echo " ImGui client : ${IMGUI_CLIENT} -host 127.0.0.1 -port ${WS_PORT}"
echo " Debugger UI : http://localhost:${UI_PORT}/"
echo " DebugService : control tcp/${CTRL_PORT}, trace udp/${UDP_PORT}, log tcp/${LOG_PORT}"
if [[ "$DANGEROUS" -eq 1 ]]; then
echo " FORCE/PAUSE/RESUME/STEP/BREAK: enabled (pass -S to disable)"
else
echo " FORCE/PAUSE/RESUME/STEP/BREAK: disabled (-S)"
fi
echo ""
echo " Press Ctrl-C to stop all processes."
echo " In the browser, press Connect (defaults to 127.0.0.1:${CTRL_PORT}),"
echo " then Discover to list the app's GAMs and signals."
echo ""
echo " Press Ctrl-C to stop both processes."
echo ""
# ── Wait until any child exits ────────────────────────────────────────────────
wait -n "${MARTE_PID}" "${HUB_PID}" ${GUI_PID:-} ${WEBUI_PID:-} 2>/dev/null || true
echo "==> A process exited — stopping remaining processes."
# ── Wait until either child exits ─────────────────────────────────────────────
wait -n "${MARTE_PID}" "${UI_PID}" 2>/dev/null || true
echo "==> A process exited — stopping the other."
+11 -4
View File
@@ -81,11 +81,16 @@ fi
# Distinct amplitude/frequency/phase per channel so traces stay tellable apart
# (and so a shared-Y-axis view has a spread of magnitudes to cope with).
AMPS=(1.0 2.5 0.5 5.0 1.5 3.0 0.8 4.0 2.0 0.3 6.0 1.2 3.5)
FREQS=(1000 2000 5000 500 10000 3000 20000 1500 7000 50000 800 4000 15000)
FREQS=(1 2000 5000 500 10000 3000 20000 1500 7000 50000 800 4000 15000)
PHASES=(0.0 0.7854 1.5708 2.3562 3.1416 3.9270 4.7124 5.4978 0.3927 1.1781 1.9635 2.7489 3.5343)
ELEMS=1000 # samples per cycle
RATE=1000 # cycles per second -> 1 Msps
ELEMS=10000 # samples per cycle
RATE=100 # cycles per second -> 1 Msps
# Declared to UDPStreamer as SamplingRate, which is the only per-signal rate it
# puts on the wire. Without it the CONFIG descriptor carries 0 and consumers show
# no rate — decoding is unaffected (FullArray signals are dated per element from
# TimeArray), but the metadata is what a client displays.
SAMPLING_RATE=$(( ELEMS * RATE ))
CYCLE_BYTES=$(( 8 * ELEMS + CHANNELS * 4 * ELEMS ))
PAYLOAD=$(( CYCLE_BYTES + 2000 )) # headroom for header + descriptors
@@ -137,6 +142,7 @@ for (( i = 1; i <= CHANNELS; i++ )); do
RangeMax = ${amp}
TimeMode = \"FullArray\"
TimeSignal = TimeArray
SamplingRate = ${SAMPLING_RATE}.0
}"
func_list+=", SineGAM${i}"
done
@@ -242,7 +248,7 @@ ${sine_gams}
// One cycle is ${CYCLE_BYTES} B; sizing the payload above that sends each
// cycle as a single datagram, which keeps the receiver's reassembly pool
// from evicting in-flight cycles and gapping the trace.
MaxPayloadSize = ${PAYLOAD}
MaxPayloadSize = 1400 //${PAYLOAD}
PublishingMode = "Strict"
Signals = {
TimeArray = {
@@ -250,6 +256,7 @@ ${sine_gams}
Unit = "ns"
NumberOfDimensions = 1
NumberOfElements = ${ELEMS}
SamplingRate = ${SAMPLING_RATE}.0
}${stream_sigs}
}
}