Skip to content

Trying to understand how many copies of data there'll be if I send with dds_writecdr #2262

@t0ny-peng

Description

@t0ny-peng

Hi there. Recently I've been using DDS writecdr a lot. Our middleware prepares a std::vector<std::byte> which contains a CDR-serialized message(plus the four bytes CDR headers), then calls dds_writecdr

  const ddsrt_iovec_t data_iovec{send_msg_data.data(), send_msg_data.size()};
  auto* serdata = ddsi_serdata_from_ser_iov(sertype, SDK_DATA, 1U, &data_iovec, send_msg_data.size());

  const auto write_ret = dds_writecdr(writer, serdata);

My understanding is that CycloneDDS will skip the CDR serialization step, as we already did it using our framework. Just curious will CycloneDDS have extra copy over this buffer before it's sent to the network device?

From me tracing the code all the way to deliver_data_network and to write_sample, the sample will be written to a WHC. And I guess this is the only copy. Just to confirm my understanding is correct. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions