Expand description
DcpsRuntime — event loop + UDP sockets per DomainParticipant.
§Structure
- Binds 3 UDP sockets per participant:
- SPDP multicast receiver (domain-based port).
- SPDP unicast fallback (ephemeral, for bidirectional SPDP).
- User unicast (ephemeral, where matched peers send to).
- Spawns a single event-loop thread that periodically:
- sends the SPDP beacon (every 5 s by default),
- polls all sockets non-blocking,
- moves SPDP datagrams into the DiscoveredParticipantsCache,
- dispatches SEDP datagrams (pub/sub announces),
- delivers user data to the correct DataReader slots,
- runs the WLP/liveliness tick,
- serves the TypeLookup service endpoints (XTypes 1.3 §7.6.3.3.4).
- Thread lifecycle via
Arc<AtomicBool> stop_flag+JoinHandleinDrop.
With the security feature active, all outbound/inbound bytes pass
through the SharedSecurityGate (DDS-Security 1.2). Multi-interface
binding (RuntimeConfig::interface_bindings) enables per-subnet routing
for production topologies.
Structs§
- Dcps
Runtime - The runtime of a
DomainParticipant. Hosts all background threads and UDP sockets. - Dcps
Tick Driver - Drives a runtime’s periodic tick from an external executor (tokio, an
embedded scheduler, a manual test loop). Obtained via
DcpsRuntime::tick_driver; only does useful work when the runtime was started withRuntimeConfig::external_tick=true. - Discovered
Endpoint Info - Helper struct for announcing a local publication/subscription
as SEDP BuiltinTopicData. The caller creates it once per
writer/reader registration and passes it to SedpStack.
QoS config for registering a user writer with the runtime.
Bundles all policies that go on the wire via SEDP plus the local
Per-endpoint discovery info for ROS 2 endpoint-info-by-topic introspection
(
rmw_get_publishers_info_by_topic/rmw_get_subscriptions_info_by_topic, the data behindros2 topic info -v). Covers local user endpoints plus remote SEDP-discovered ones. QoS is best-effort from what discovery carries (history/depth are not on the wire, so the consumer fills rmw defaults). - Runtime
Config - Configuration for the runtime. Exposed via DomainParticipant factory methods.
- User
Reader Config - QoS config for registering a user reader.
- User
Writer Config - monitoring. Avoids 10+-argument functions.
Enums§
- User
Sample - Sample channel item: either data payload or lifecycle marker.
Lifecycle is reconstructed by the wire path as
key_hash + ChangeKindfrom the PID_STATUS_INFO header; the DataReader DCPS layer translates that into__push_lifecycle. - User
Transport Kind - Choice of transport for DCPS user traffic. Discovery (SPDP/SEDP) remains UDPv4 multicast independently of this.
Constants§
- DEFAULT_
INITIAL_ ANNOUNCE_ COUNT - Default number of SPDP announces sent at the fast initial-burst cadence
(C3 WiFi-robust discovery) before falling back to
DEFAULT_SPDP_PERIOD. Analogous to Fast DDSinitial_announcements. - DEFAULT_
INITIAL_ ANNOUNCE_ PERIOD - Default period between initial-announcement-burst SPDP sends.
- DEFAULT_
SPDP_ PERIOD - Default SPDP announce period (Spec §8.5.3.2 recommends 5 s).
- DEFAULT_
TICK_ PERIOD - Default tick period of the event loop.
- USER_
PAYLOAD_ ENCAP - RTPS serialized-payload header for user samples:
CDR_LE(PLAIN_CDR / XCDR1, little-endian) + options=0. Spec OMG RTPS 2.5 §9.4.2.13.
Functions§
- user_
multicast_ endpoint - Default user-multicast locator for a DomainParticipant. Not used in live mode 1 yet; SPDP-announced in B2.
Type Aliases§
- User
Reader Listener - User-reader slot. ReliableReader + topic meta + channel to the DataReader (DCPS API side). Listener callback for sample arrival.
- User
Sample With Encap - The listener dispatch carries, alongside the
UserSample, a zero-copy view on the originalArc<[u8]>with an encap offset (lever-E zero-copy path).