Skip to main content

Module reliable_reader

Module reliable_reader 

Source
Expand description

Reliable RTPS reader (1:N writer proxies) — DDSI-RTPS 2.5 §8.4.10.

Corresponds to the StatefulReader role with 1..N matched writers. Fragmentation (§8.4.14) is supported. Multi-writer since WP 1.4 T4.5: a separate WriterProxyState per remote writer with its own received_cache, delivered_up_to and FragmentAssembler.

§Why per-proxy state?

SequenceNumbers are writer-local (Spec §8.3.5.4). Two writers with overlapping SN spaces would collide in a global cache — hence separate buffers per proxy.

§API-Form

  let mut r = ReliableReader::new(...);
  r.add_writer_proxy(proxy_for_remote_A);
  loop {
      match transport.recv_submessage() {
          Data(d)      => for s in r.handle_data(&d) { deliver(s) },
          DataFrag(df) => for s in r.handle_data_frag(&df, uptime()) { deliver(s) },
          Heartbeat(h) => r.handle_heartbeat(&h, uptime()),
          Gap(g)       => for s in r.handle_gap(&g) { deliver(s) },
      }
      for dg in r.tick(uptime())? { transport.send(dg) }
  }

Structs§

DeliveredSample
A sample delivered to the application.
ReliableReader
A reliable reader with 0..N writer proxies.
ReliableReaderConfig
Configuration at creation.
WriterProxyState
Per-writer state: the proxy + separate receive state.

Constants§

DEFAULT_HEARTBEAT_RESPONSE_DELAY
Default heartbeat response delay.