my DDS writer works fine when write small-size data. However, when I send large-size data with DDS writer, I got this error at runtime.
DDS_OctetsPlugin_serialize:value length cannot be greater than alloc size
PRESWriterHistoryDriver_initializeSample:serialize sample error in topic 'xxxxx' with type 'DDS::Octets' and encapsulationId 1
WriterHistoryMemoryPlugin_addEntryToSession:!initialize sample
WriterHistoryMemoryPlugin_addEntryToSessions:!add entry to first session
WriterHistoryMemoryPlugin_getEntry:!add virtual sample to sessions
WriterHistoryMemoryPlugin_addSample:!get entry
PRESWriterHistoryDriver_addWrite:!add_sample in topic 'xxxxx'
PRESPsWriter_writeInternal:!collator addWrite
terminate called after throwing an instance of 'dds::core::Error'
what():
DDS_OctetsPlugin_serialize:value length cannot be greater than alloc size
PRESWriterHistoryDriver_initializeSample:serialize sample error in topic 'Pandar20P_BB_UdpPacketList' with type 'DDS::Octets' and encapsulationId 1
WriterHistoryMemoryPlugin_addEntryToSession:!initialize sample
WriterHistoryMemoryPlugin_addEntryToSessions:!add entry to first session
WriterHistoryMemoryPlugin_getEntry:!add virtual sample to sessions
WriterHistoryMemoryPlugin_addSample:!get entry
PRESWriterHistoryDriver_addWrite:!add_sample in topic 'xxxxx'
PRESPsWriter_writeInternal:!collator addWrite
Following is my code:
auto dp = dds::domain::DomainParticipant(1);
auto topic = dds::topic::Topic<dds::core::BytesTopicType>(dp, channelName);
auto qos = dds::core::QosProvider::Default().datawriter_qos();
writer = dds::pub::DataWriter<dds::core::BytesTopicType>(Publisher(dp), topic, qos, &writerListener);
writer.write(data);
Any help is appreciated.