[ndnSIM] Error while calling applications public member functions from scenario

Muhammad Hosain Abdollahi Sabet mhasabet at gmail.com
Sat Mar 18 04:15:03 PDT 2017


Hi there,

Continuing this issue, I wanted to access ndn application member functions.
How can I resolve the application name? I mean I have tried with
Downcasting to ns3::ndn::Producer, but compiler gave me:

‘Producer’ is not a member of ‘ns3::ndn’

Thanks,
Sabet


On Mon, Aug 15, 2016 at 1:23 AM, Alex Afanasyev <aa at cs.ucla.edu> wrote:

>
> On Aug 14, 2016, at 12:14 PM, Junxiao Shi <shijunxiao at email.arizona.edu>
> wrote:
>
> Hi Sabet
>
> This usually occurs when you are trying to send a packet when processing a
> packet. You need a io.post in real application or
> ns3::Simulator::ScheduleNow in simulated application *somewhere*.
>
> Yours, Junxiao
>
> On Aug 13, 2016 10:37 PM, "Muhammad Hosain Abdollahi Sabet" <
> mhasabet at gmail.com> wrote:
>
>> Hi,
>>
>> I have a custom application *"CustomApp". *I have put SendInterest() in
>> public so I can call it from scenario, for testing purposes. With this snap:
>>
>>   ndn::AppHelper app1("CustomApp");
>>>   ApplicationContainer appCont = app1.Install(ConsNode);
>>>
>>>   Ptr<CustomApp> app1ptr = DynamicCast<CustomApp>(appCont.Get(0));
>>>   app1ptr->SendInterest();
>>>
>>
> As Junxiao already pointed out, you cannot do this.  One of the reasons is
> that this code in main() function merely sets up the simulation.  The
> installed applications is "logically" installed on the node, and it doesn't
> necessarily has to start at the beginning of the simulation (it is just an
> accident that in your simulation it does, as you used the default
> start/stop times).
>
> I would recommend checking the example applications, e.g.,
> http://ndnsim.net/2.1/applications.html#customer-example. You need two
> things,
> - initiate application tasks only after StartApplication is called
> - schedule send interest operation, not invoke it directly
>
> --
> Alex
>
>
>> I'm getting:
>>
>> Command ['.../ns-3/build/scratch/simple-custom-app'] terminated with
>>> signal SIGSEGV. Run it under a debugger to get more information (./waf
>>> --run <program> --command-template="gdb --args %s <args>").
>>>
>>
>> which buy following gdb(insight) I end up :
>>
>> BOOST_ASSERT_MSG(!m_isExecuting, "cannot emit signal from a handler");
>>
>>
>>  It is from:
>> https://github.com/named-data-ndnSIM/ndn-cxx/blob/master/src
>> /util/signal-signal.hpp:224
>> Branch: ndn-cxx.0.3.4-ndnSIM
>>
>> I have tested app1ptr with some sample doing-nothing-but-LOG member
>> function and it worked.
>>
>> I appreciate it if you could help me on what is wrong.
>>
>> Thanks,
>> Sabet
>>
>>
>>
>> _______________________________________________
>> ndnSIM mailing list
>> ndnSIM at lists.cs.ucla.edu
>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>
>> _______________________________________________
> 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/20170318/f3af0b53/attachment.html>


More information about the ndnSIM mailing list