<div dir="auto">Hi Rayhan<div dir="auto"><br></div><div dir="auto">ndn-cxx Face and KeyChain types are non-thread-safe.</div><div dir="auto">You should create only one Face and one KeyChain.</div><div dir="auto">Pass them to every application component that needs them.</div><div dir="auto">Invoke face.processEvents() in one thread only, and perform all other tasks that interact with the face within callback functions.</div><div dir="auto"><br></div><div dir="auto">Yours, Junxiao</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 2, 2022, 05:44 Gias, Rayhan <<a href="mailto:rayhan.gias@hs-emden-leer.de">rayhan.gias@hs-emden-leer.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr"><p style="text-align:center"><font color="red"><strong>External Email</strong><br></font></p>
<div id="m_3981338879615430223divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p></p>
<div>Dear all,</div>
<div><br>
</div>
<div>I am trying to adopt NDND(<a href="https://github.com/Zhiyi-Zhang/NDND" target="_blank" rel="noreferrer">https://github.com/Zhiyi-Zhang/NDND</a>) and PSync.</div>
<div><br>
</div>
<div>I want to discover NDN neighbor hosts which are on the same network. At the same time, I have a Psync producer to publish data and PSync consumer to consume.</div>
<div><br>
</div>
<div>Both of these are seperate class objects have Face.processEvents() callback member function. I am invoking this function from separate threads.</div>
<div><br>
</div>
<div>´´´</div>
<div>std::thread th1(&NDNDClient::run_face, client);</div>
<div>std::thread th2(&PSyncPartialProducer::run_face, simple_producer);</div>
<div>std::thread th3(&PSyncPartialConsumer::run_face, simple_consumer);</div>
<div><br>
</div>
<div>```</div>
<div><br>
</div>
<div>If I do not invoke th1 thread then both producer and consumer works properly. But when I am running th1 then I am getting the following error:</div>
<div><br>
</div>
<div>libc++abi: terminating with uncaught exception of type boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<psync::ProducerBase::Error> >: authorization rejected</div>
<div><br>
</div>
<div>here is the client code which I have adopted to my codebase:</div>
<div><br>
</div>
<div><a href="https://github.com/Zhiyi-Zhang/NDND/blob/master/nd-client.cpp" target="_blank" rel="noreferrer">https://github.com/Zhiyi-Zhang/NDND/blob/master/nd-client.cpp</a></div>
<div><br>
</div>
<div>What is it I am missing? Can anybody explain to me how to solve the issue?</div>
<div><br>
</div>
<div>Thank you in advance.</div>
<br>
Best regards,<br>
T M Rayhan Gias
<p></p>
</div>
</div>

_______________________________________________<br>
Nfd-dev mailing list<br>
<a href="mailto:Nfd-dev@lists.cs.ucla.edu" target="_blank" rel="noreferrer">Nfd-dev@lists.cs.ucla.edu</a><br>
<a href="https://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev" rel="noreferrer noreferrer" target="_blank">https://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev</a><br>
</blockquote></div>