<div dir="ltr"><div>Thanks Spyridon ! It works now.<br><br></div>Regards,<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 6, 2015 at 1:59 AM, Spyridon (Spyros) Mastorakis <span dir="ltr"><<a href="mailto:spiros.mastorakis@gmail.com" target="_blank">spiros.mastorakis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
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?<br>
<br>
An example that worked for me is the following:<br>
<br>
 ndn::Exclude m_exclude;<br>
 m_exclude.appendExclude(ndn::name::Component("postfix_of_disovered_ser"), false);<br>
 interest->setExclude(m_exclude);<br>
<br>
Did you use a debugger to check that the runtime error comes indeed from these methods?<br>
<br>
Hope that this helps.<br>
<br>
--<br>
Spyridon (Spyros) Mastorakis<br>
Personal Website: <a href="http://cs.ucla.edu/~mastorakis/" rel="noreferrer" target="_blank">http://cs.ucla.edu/~mastorakis/</a><br>
Internet Research Laboratory<br>
PhD Computer Science<br>
UCLA<br>
<div><div class="h5"><br>
<br>
<br>
<br>
> On Jul 5, 2015, at 8:10 PM, Sugang Li <<a href="mailto:sugang.li718@gmail.com">sugang.li718@gmail.com</a>> wrote:<br>
><br>
> Hi there,<br>
><br>
> 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.<br>
><br>
> 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.<br>
><br>
> my code is attached here:<br>
> In header:<br>
> ......<br>
> private:<br>
> ndn::Exclude &m_exclude;<br>
> .......<br>
><br>
> In cpp:<br>
> ......<br>
> m_exclude->appendExclude(ndn::name::Component("postfix_of_disovered_ser"),true);<br>
> interest->setExclude(*m_exclude);<br>
><br>
><br>
> Anyone can give me a example will be appreciated!<br>
><br>
> Thanks,<br>
><br>
> --<br>
> Sugang Li<br>
> Rutgers,the State University of New Jersey<br>
> Department of Electrical and Computer Engineering<br>
</div></div>> _______________________________________________<br>
> ndnSIM mailing list<br>
> <a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>
> <a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><b><i>Sugang Li</i></b><div><b><i>Rutgers,the State University of New Jersey<br></i></b><div><b><i>Department of Electrical and Computer Engineering</i></b></div></div></div>
</div>