Accepts connections and enables transmitting and receiving binary data streams for modeled ports.
Context
The class ara::rds::RawDataStreamServer represents the server-side counterpart for stream-oriented data transmissions in the AUTOSAR Adaptive Platform (module rds) SWS RawDataStream p. 1. Its main task is to accept incoming client connections at a modeled communication port and handle the subsequent bidirectional exchange of unstructured raw data via binary data streams.
The central interaction partners include:
- the higher-level server application, which creates the instance, awaits connections, and initiates data transmission,
- the AUTOSAR runtime system, to which the server is bound via an
ara::core::InstanceSpecifier for a modeled port [SWS_RDS_11312],
- the external client, which establishes a connection to the server [SWS_RDS_11318] and exchanges payload data [SWS_RDS_11322], [SWS_RDS_11324].
Lifecycle
The instantiation of an RawDataStreamServer does not occur via ordinary constructors, but exclusively via the static factory method Create [SWS_RDS_11312]. This binds the server to the port specified via ara::core::InstanceSpecifier.
Regarding ownership, the class enforces strict move-only semantics. The copy constructor [SWS_RDS_11316] and the copy assignment operator [SWS_RDS_11317] are explicitly deleted (delete). Passing resources to other scopes is therefore only possible via the move constructor [SWS_RDS_11314] or the move assignment operator [SWS_RDS_11315].
Interpretation: After successful creation, the server instance is in an initial state of readiness in which no active connection exists yet. Question Q-5d536f7c10a62342 (open) Via WaitForConnection [SWS_RDS_11318] or the time-monitored variant WaitForConnection(timeout) [SWS_RDS_11319], the server waits for a client and, on success, transitions to the state of an active connection. The connection can be closed deliberately at runtime by calling Shutdown [SWS_RDS_11320].
When the server instance is destroyed, the destructor ~RawDataStreamServer ensures that a still open connection is automatically shut down and closed properly [SWS_RDS_11313].
Regarding concurrency, the creation method Create is specified as thread-safe [SWS_RDS_11312]. In contrast, the move operations [SWS_RDS_11314], [SWS_RDS_11315] as well as the destructor [SWS_RDS_11313] are explicitly identified as not thread-safe (not thread-safe) and require external synchronization protection upon concurrent access from multiple threads.
State diagram: Phases of a server instance from creation to connection acceptance and connection termination. Sources: [SWS_RDS_11312], [SWS_RDS_11318], [SWS_RDS_11320], [SWS_RDS_11313]
Usage Path
The typical usage path of a server application comprises the steps of initialization, waiting for connections, bidirectional data transfer, and connection termination:
- Create server: The application instantiates the server via
ara::rds::RawDataStreamServer::Create(instance) for the configured port [SWS_RDS_11312].
- Wait for connection: The application blocks using
WaitForConnection() [SWS_RDS_11318] or with a configured maximum duration via WaitForConnection(timeout) [SWS_RDS_11319] until a client has established the connection.
- Receiving and sending data: After a successful connection, the application reads binary data using
ReadData(maxLength) [SWS_RDS_11322] or with time monitoring via ReadData(maxLength, timeout) [SWS_RDS_11323]. To send binary data, WriteData is called, optionally without a timeout limit [SWS_RDS_11324] or with time monitoring [SWS_RDS_11325]. Sending via WriteData presumably transfers ownership of the provided byte buffer (std::unique_ptr<ara::core::Byte[]>) to the server. Question Q-eec0fea4a5ffaf40 (open)
- Disconnecting: Once data transfer is complete, the application explicitly terminates the session via
Shutdown() [SWS_RDS_11320].
Sequence diagram: Sequence of creation, connection acceptance, data exchange, and connection termination. Sources: [SWS_RDS_11312], [SWS_RDS_11318], [SWS_RDS_11322], [SWS_RDS_11324], [SWS_RDS_11320]
Error Scenarios
Error handling of RawDataStreamServer follows the principles of the AUTOSAR Adaptive Platform for fail-safe interfaces:
None of the methods throw C++ exceptions; all functions are declared as noexcept SWS RawDataStream p. 1. Error cases are instead communicated to the caller via return type ara::core::Result.
Typical error scenarios include:
- Timeouts: For methods
WaitForConnection [SWS_RDS_11319], ReadData [SWS_RDS_11323], and WriteData [SWS_RDS_11325] with timeout, expiration of the specified time period leads to an error state in the returned ara::core::Result.
- Connection errors and invalid states: In the event of an error (such as a prematurely disconnected connection or internal communication errors), methods
ReadData, WriteData, and WaitForConnection are likely to return corresponding error codes in ara::core::Result. Question Q-0c6815ddde412d81 (open)
- Pre- and postconditions: Callers must always check the returned
ara::core::Result for validity prior to accessing data values to ensure the error-free state of the operation.
This guide is based on the AUTOSAR Adaptive R25-11 specification and was generated automatically.
gemini-3.8-flash-low· 2026-10-13 · German original