Good morning.
Is it possible to know the size of a bundle when it is received by the peer? I would like to have this information on the log but in the BundleReceivedEvent.cpp I cannot have access to this information.
Thank you
Best regards,
Bruno Tavares
Hello Bruno,
the BundleReceivedEvent allows you to access the "bundle". The size of the payload is accessable through the list of blocks.
const dtn::data::PayloadBlock &pblock = bundle.find<const dtn::data::PayloadBlock>(); const dtn::data::Number payloadlength = pblock.getLength();
The size of the encoded bundle depends on the Serializer. You could use something like this to guess the encoded bundle size.
dtn::data::DefaultSerializer s(std::cout); dtn::data::Length size = s.getLength(bundle);
Kind regards, Johannes Morgenroth
Am 23.07.2013 10:54, schrieb Bruno Tavares:
Good morning.
Is it possible to know the size of a bundle when it is received by the peer? I would like to have this information on the log but in the BundleReceivedEvent.cpp I cannot have access to this information.
Thank you
Best regards,
Bruno Tavares
-- !! This message is brought to you via the `ibr-dtn' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or adjust !! your settings, send a mail message to ibr-dtn-request@ibr.cs.tu-bs.de !! or look at https://www.ibr.cs.tu-bs.de/mailman/listinfo/ibr-dtn.
participants (2)
-
Bruno Tavares
-
Johannes Morgenroth