[ndnSIM] How to define a function to receive the name of Data Packets from the Producer App

Spyridon (Spyros) Mastorakis mastorakis at cs.ucla.edu
Fri Mar 1 15:45:13 PST 2019


Hi,

why this onData function would not work?

If you are not receiving data packets, enable the nfd.Forwarder logging component to see what is going on.

Thanks,

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA

> On Mar 1, 2019, at 11:57 AM, Kamrul Morshed via ndnSIM <ndnsim at lists.cs.ucla.edu> wrote:
> 
> Greetings ndnSIMers,
> 
> Using the following function, I can receive the name of the interest from the consumer node
> 
> void
> CustomApp::OnInterest(std::shared_ptr<const ndn::Interest> interest)
> {
>   ndn::App::OnInterest(interest); // forward call to perform app-level tracing
>   // do nothing else (receive interest from consumer)
>   NS_LOG_DEBUG("Requesting Interest from Consumer" << interest->getName());  
> }
> 
> Similarly,  I would like to receive the name of Data packets, 
> however, defining a similar function would not work. 
> 
> For example,
> 
> void
> CustomApp::OnData(std::shared_ptr<const ndn::Data> data)
> {
>   ndn::App::OnData(data); // forward call to perform app-level tracing 
>   // do nothing else (receive data from producer)
>   NS_LOG_DEBUG("Requesting Data from Producer" << data->getName());  
> }
> 
> What would be the correct approach to retrieve the name of the data packet ?
> 
> 
> Sincerely,
> Kamrul Morshed
> 
> 
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20190301/46bd0ccb/attachment.html>


More information about the ndnSIM mailing list