[Nfd-dev] [EXT] NDN neighbor discovery conflicts with PSync

Junxiao Shi shijunxiao at email.arizona.edu
Thu Jun 2 02:51:41 PDT 2022


Hi Rayhan

ndn-cxx Face and KeyChain types are non-thread-safe.
You should create only one Face and one KeyChain.
Pass them to every application component that needs them.
Invoke face.processEvents() in one thread only, and perform all other tasks
that interact with the face within callback functions.

Yours, Junxiao

On Thu, Jun 2, 2022, 05:44 Gias, Rayhan <rayhan.gias at hs-emden-leer.de>
wrote:

> *External Email*
>
> Dear all,
>
> I am trying to adopt NDND(https://github.com/Zhiyi-Zhang/NDND) and PSync.
>
> 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.
>
> Both of these are seperate class objects have Face.processEvents()
> callback member function. I am invoking this function from separate threads.
>
> ´´´
> std::thread th1(&NDNDClient::run_face, client);
> std::thread th2(&PSyncPartialProducer::run_face, simple_producer);
> std::thread th3(&PSyncPartialConsumer::run_face, simple_consumer);
>
> ```
>
> 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:
>
> libc++abi: terminating with uncaught exception of type
> boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<psync::ProducerBase::Error>
> >: authorization rejected
>
> here is the client code which I have adopted to my codebase:
>
> https://github.com/Zhiyi-Zhang/NDND/blob/master/nd-client.cpp
>
> What is it I am missing? Can anybody explain to me how to solve the issue?
>
> Thank you in advance.
>
> Best regards,
> T M Rayhan Gias
>
> _______________________________________________
> Nfd-dev mailing list
> Nfd-dev at lists.cs.ucla.edu
> https://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20220602/609c55d5/attachment.html>


More information about the Nfd-dev mailing list