[ndnSIM] problem with setExclude
Alex Afanasyev
alexander.afanasyev at ucla.edu
Wed Jul 22 23:23:07 PDT 2015
Hi Sugan,
I would answer your question slightly differently. You should not directly use setExclude, as it is more or less an implementation detail. Exclude class proves a few methods to be used instead: excludeOne, excludeRange, excludeBefore, and excludeAfter.
---
Alex
> On Jul 6, 2015, at 1:59 PM, Spyridon (Spyros) Mastorakis <spiros.mastorakis at gmail.com> wrote:
>
> Hi,
>
> 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);
> interest->setExclude(m_exclude);
>
> 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
> UCLA
>
>
>
>
>> 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
>
>
> _______________________________________________
> 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