[ndnSIM] Access a variable in ndn-consumer.cpp file
Spyridon (Spyros) Mastorakis
mastorakis at cs.ucla.edu
Mon Sep 24 20:22:28 PDT 2018
Hi,
this method is executed every time a NACK is received. Therefore, your counter should be initialized when the consumer is initialized.
I am not sure whether you can access an application attribute from the simulation scenario. At least, I do not think I have tried to do so. Probably you can send an email to the NS-3 mailing list and ask.
Thanks,
Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA
> On Sep 20, 2018, at 9:14 PM, madhurima buragohain <madhurimajya at gmail.com> wrote:
>
> Dear All,
>
> I want to count the number of NACK packets received in consumer.cpp file.
>
> I have declared a variable "count" in ndn-consumer.hpp to count the number of NACK packets received.
>
> void
> Consumer::OnNack(shared_ptr<const lp::Nack> nack)
> {
> static int count=0;
> count++;
> .....
> }
>
> I want to access the value "count " from the ndn-simple.cc file in scratch.
> How should I proceed?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180924/fbd6de54/attachment.html>
More information about the ndnSIM
mailing list