Question about multi-point session join time.

asked 2014-05-08 23:34:01 -0700

herodion gravatar image

Target : Android Kitkat device Langauge : C++

Hi, All. I need to send broadcasting packet in my alljoyn project so I used multi-point session(refer to the chat sample.) I have one question about multi-point session.

The more client join the session the more time needed to join successfully. Sometimes 16th client spend more than 10 seconds to join completely.

In my project, connection time is very important. Thus I want all client(MAX 16 device) to join the session in 3 seconds.

how can I make it faster?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-05-13 14:38:08 -0700

bspencer gravatar image

What you are experiencing is a File Descriptor problem for your application in which you have hit the threshold of the number of completed connections that can be made which is 15 (1 used by local application). The 16th device ends up kicking off . What you can do is recompile the AllJoyn SDK for Android and change the router/bundled/BundledRouter.cc file to set

"  <limit max_completed_connections=\"32\"/>"

The other option is that you can use to test is create a config.xml with the different config settings and use the debug SDK. Now adb push the config.xml you created to /sdcard/.alljoyn/config.xml. When the BusAttachment is created with the debug version of the SDK, it will try and load a developer config file placed in the sdcard .alljoyn folder.

What puzzles me slightly is that you say each time an app connects it takes longer? Can you share the code you have for the service side for the AcceptSessionJoiner method? This should not block and should return quickly. Are you making a call up into Dalvik or anything in this method?

edit flag offensive delete publish link more

answered 2014-05-13 21:42:29 -0700

herodion gravatar image

Dear Spencer,

I already increase and re-build SDK limit connection count you mentioned as below.

limit max_incomplete_connections=16
limit max_completed_connections=64

This is my AcceptSessionJoiner function.

bool CMyBusListener::AcceptSessionJoiner(SessionPort sessionPort, const char* joiner, const SessionOpts& opts) 
    if (sessionPort != SESSION_PORT) {
         ALOGD("Rejecting join attempt on non-aat session port %d\n", sessionPort);
         return false;
return true; 

and this is my sessionopts.(multi point session)

SessionOpts opts(SessionOpts::TRAFFIC_MESSAGES, true, SessionOpts::PROXIMITY_ANY, TRANSPORT_ANY);

When first client join the session, it takes very short time.(in 1 sec) But more clients join the same session, it is getting slowly.

For example, 10 clients already have joined the session. In this state, if 11th client try to join the session then it takes very long time. I think the time increases in proportion to the number of already connected.

I want to make this join time more shortly. Can you give me any hints??

Thanks a lot.

edit flag offensive delete publish link more


Can you also share with us on how are you making the join session calls ? I am interested in finding out if it is the way that you are making join session calls that might be causing this.

Nikhil Dabhade ( 2014-05-15 13:35:40 -0700 )edit

Can you also tell us which branch are you using to build the SDK ?

Nikhil Dabhade ( 2014-05-15 13:49:57 -0700 )edit

Below is JoinSession Calls. void CMyBusListener::FoundAdvertisedName(const char* name, TransportMask transport, const char* namePrefix) { if(strcmp(m_sMyName,name) != 0) { QStatus status; SessionId sessionid; SessionOpts opts(SessionOpts::TRAFFIC_MESSAGES, true, SessionOpts::PROXIMITY_ANY, TRANSPORT_ANY); m_Bus->EnableConcurrentCallbacks(); status = m_Bus->JoinSession(name, SESSION_PORT, this, sessionid, opts); if (ER_OK == status) { ALOGD("JoinSession Success \"%s\"(%d)\n", name, sessionid); } else { ALOGD("JoinSession failed (status=%s)\n", QCC_StatusText(status)); } } }

herodion ( 2014-05-15 17:56:42 -0700 )edit

I am using SDK based 3.4.5 version.

herodion ( 2014-05-15 17:58:04 -0700 )edit

Can you please refactor your code to use JoinSessionAsync and remove the EnableConcurrentCallbacks. This is a better way to accomplish what you are trying to doing with speed and ability to join multiple sessions. See this sample test code as a reference: https://git.allseenalliance.org/cgit/core/alljoyn.git/tree/alljoyn_core/test/bbjoin.cc Also, please update to the 14.02 version of the SDK.

bspencer ( 2014-05-16 09:43:49 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-05-08 23:34:01 -0700

Seen: 578 times

Last updated: May 13 '14