Sending many large data samples

2 posts / 0 new
Last post
Offline
Last seen: 8 years 3 months ago
Joined: 12/01/2015
Posts: 2
Sending many large data samples

Hi,
I'm trying to send 100 un-keyed samples, each of 10 mega-bytes and the writer fails with a code of 10 which according to the header means DDS_RETCODE_TIMEOUT. I have previously done some research and looked at existing forum topics and as a result I'm using the following QOS settings on the writer:

  writerQos.reliability.kind = DDS_RELIABLE_RELIABILITY_QOS;

  // For reliable large data
  writerQos.publish_mode.kind = DDS_ASYNCHRONOUS_PUBLISH_MODE_QOS;
  writerQos.publish_mode.flow_controller_name =
     DDS_DEFAULT_FLOW_CONTROLLER_NAME;
  writerQos.history.kind = DDS_KEEP_ALL_HISTORY_QOS;
  writerQos.resource_limits.max_samples = SEND_QUEUE_SZ;
  writerQos.resource_limits.initial_samples = SEND_QUEUE_SZ;
  writerQos.resource_limits.max_samples_per_instance
      = writerQos.resource_limits.max_samples;

  writerQos.protocol.rtps_reliable_writer.disable_positive_acks_min_sample_keep_duration.sec = (int)KEEP_DURATION_USEC / 1000000;
  writerQos.protocol.rtps_reliable_writer.disable_positive_acks_min_sample_keep_duration.nanosec = KEEP_DURATION_USEC % 1000000;

  // Matches the DDS default
  //writerQos.durability.kind = (DDS_DurabilityQosPolicyKind)DDS_VOLATILE_DURABILITY_QOS;

  // Matches the DDS default
  //writerQos.durability.direct_communication = true;

  writerQos.protocol.rtps_reliable_writer.heartbeats_per_max_samples = SEND_QUEUE_SZ / 10;

  writerQos.protocol.rtps_reliable_writer.low_watermark = SEND_QUEUE_SZ * 1 / 10;
  writerQos.protocol.rtps_reliable_writer.high_watermark = SEND_QUEUE_SZ * 9 / 10;

  writerQos.protocol.rtps_reliable_writer.max_send_window_size = SEND_QUEUE_SZ;
  writerQos.protocol.rtps_reliable_writer.min_send_window_size = SEND_QUEUE_SZ;

  writerQos.resource_limits.max_instances = INSTANCE_COUNT;
  writerQos.resource_limits.initial_instances = INSTANCE_COUNT;

The code is also using the following values for the constants:

  static const int SEND_QUEUE_SZ = 10;
  static const int INSTANCE_COUNT = 1;
  static const int KEEP_DURATION_USEC = 1000;

Help will be very much appreciated.

Julian

 

Juanjo Martin's picture
Offline
Last seen: 1 year 7 months ago
Joined: 07/23/2012
Posts: 48

Hi Julian,

DDS_RETCODE_TIMEOUT is returned when the DataWriter can't write more samples with the current resources and the reliability.max_blocking_time expires. I'd give a try to increase max_blocking_time or the send window size (as well as the resource limits, what means increasing your SEND_QUEUE_SZ variable).

Thanks,
Juanjo