-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataWriter fails to write message #461
Comments
Seems the issue is that the serialized size is not calculated properly. template<typename T, class S>
bool get_serialized_size(const T& sample, bool as_key, size_t &sz)
{
if (TopicTraits<T>::isSelfContained()) {
if ((as_key && !get_serialized_fixed_size<T,S,true>(sample, sz)) ||
(!as_key && !get_serialized_fixed_size<T,S,false>(sample, sz)))
return false;
} else {
S str;
if (!move(str, sample, as_key))
return false;
sz = str.position();
}
return true;
} Here Actually is it correct that my struct with all optionals is self contained? Because |
except branch idl_is_type_spec(node)
I am using
0.10.4
and have the followingmessage.idl
Then I generate the data types using:
idlc -b . -l <path to libcycloneddsidlcxx> -x final message.idl
Then I create 2 messages and try to write them using
DataWriter
. However sending the second message fails withwrite failed
exception.Here is my code:
The output is:
So writing
m2
fails. However if I first writem2
and thenm1
then everything works fine.The actual method which fails is:
For some reason there is no space left in the
cdr_stream
buffer to serialize the second message.@eboasson
The text was updated successfully, but these errors were encountered: