[ndnSIM] problem with setExclude

Spyridon (Spyros) Mastorakis spiros.mastorakis at gmail.com
Sun Jul 5 22:59:43 PDT 2015


Do you need to set the boolean variable in the arguments of the appendExclude method to true for some reason? Did you try to switch it to false?

An example that worked for me is the following:

 ndn::Exclude m_exclude;
 m_exclude.appendExclude(ndn::name::Component("postfix_of_disovered_ser"), false);

Did you use a debugger to check that the runtime error comes indeed from these methods?

Hope that this helps.

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

> On Jul 5, 2015, at 8:10 PM, Sugang Li <sugang.li718 at gmail.com> wrote:
> Hi there,
> I am working on a service discovery protocol which might use the "Exclude" field in Interest.  However, after searching for a while, I coul not find too many examples to show how to use setExclude, and I kept receive segmentation fault when I tried it.
> In my case, I send a Interest  named "/service" to the network, and the potential producers are "/service/1" "/service/2" and "/service/2".  So the first time, one Data "/service/1" comes back, and consumer excludes it and send a Interest again. Repeat this until all the producers are discovered.
> my code is attached here:
> In header:
> ......
> private:
> ndn::Exclude &m_exclude;
> .......
> In cpp:
> ......
> m_exclude->appendExclude(ndn::name::Component("postfix_of_disovered_ser"),true);
> interest->setExclude(*m_exclude);
> Anyone can give me a example will be appreciated!
> Thanks,
> -- 
> Sugang Li
> Rutgers,the State University of New Jersey
> Department of Electrical and Computer Engineering
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

More information about the ndnSIM mailing list