[ndnSIM] How to get the payload of the Data packet as what it originally is
mengxue
mengxue_1224 at 126.com
Mon Sep 17 18:16:32 PDT 2018
Hi,
Thank you very much, I will have a try.
Best Regards
Xue Meng
| |
mengxue
|
|
邮箱:mengxue_1224 at 126.com
|
签名由 网易邮箱大师 定制
On 09/14/2018 10:29, Spyridon (Spyros) Mastorakis wrote:
Hi,
this is related to properly encoding/decoding the payload of your data packets.
There are a few examples of encoding/decoding you can refer to:
https://github.com/spirosmastorakis/nTorrent/blob/master/src/torrent-file.cpp#L97
https://github.com/spirosmastorakis/nTorrent/blob/master/src/torrent-file.cpp#L158
https://github.com/spirosmastorakis/nTorrent/blob/master/src/file-manifest.cpp#L147
https://github.com/spirosmastorakis/nTorrent/blob/master/src/file-manifest.cpp#L253
Thanks,
Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/
Internet Research Laboratory
Computer Science Department
UCLA
On Sep 13, 2018, at 2:15 AM, mengxue <mengxue_1224 at 126.com> wrote:
Hi,all
I am new in ndnSIM and met with some problems recently.
Assume that I defined a class " Student " and want to attach an instantiation named " newStudent " of the "Student" class as the payload of a Data packet.
I wonder what should I do to set this instantiation as the payload of the Data packet so that in other nodes I can get the payload just as what it originally is,i.e.,"newStudent" , so that I can do some operations on the "newStudent".
I have tried on the API documentation but not found the solutions using "Data::setpayload()" and "Data::getpayload()".
Thank you very much!
Best regards,
Xin Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180918/05563397/attachment.html>
More information about the ndnSIM
mailing list