What is the best practice to invoke more than 8 functions sequentially in AllJoynJS?

asked 2015-02-10 02:30:30 -0700

FabriceFontaine gravatar image

I use AllJoynJS for registering signals through the AJ.addMatch function.

The 8 first calls are ok however when I call AJ.addMatch a 9th time, an AJ_ERR_RESSOURCES error is returned by ajtcl/src/aj_introspect.c because all the reply contexts are full. I found that this maximum (AJ_NUM_REPLY_CONTEXTS) is set to 8 for Linux/Windows in SConscript .

I have the same issue if I invoke 9 times the .getProp function.

So my question is what is the best practice to invoke more than 8 functions sequentially in AllJoynJS:

  • Add a setTimeout in the JS script to delay the invocation of actions: this works but this is not very convenient and should be at least specified in the AllJoynJS documentation
  • Increase AJ_NUM_REPLY_CONTEXTS but in this case, why the default value for Linux/Windows is so low?
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-02-10 16:42:51 -0700

jprestwo gravatar image

The number of reply contexts is set to 8 just to keep the thin client's memory footprint as low as possible. It was made configurable so the developer (you) can change it depending on the resources available on their platform. It used to be even lower but as AllJoyn aged it was increased to what it is now. In your case I would just compile Thin Client with a number that works for your system. If others begin to have the same problem you do then perhaps the default could be increased but for now 8 seems to be enough for the majority of use cases.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-02-10 02:30:30 -0700

Seen: 123 times

Last updated: Feb 10 '15