Android Simple Client cannot connect to service second time

asked 2014-12-03 17:30:54 -0700

Blake.Chen gravatar image

updated 2014-12-03 19:33:04 -0700

I am using 14.06 android sample "Simple Client" and try to connect it to basic_service from the latest linux code of git. I have set the same (1)interface name, (2)service name, (3)service path and (4)session port.

I have 2 problems: 1. The android sample "Simple Client" shows "ALLJOYN_JOINSESSION_REPLY_UNREACHABLE" message but still connects to the "basic_service" on linux (There are some error message showed in basic_service: UDPTransport::AcceptCb(): ARDP_Accept() failed: ER_FAIL). The ping function works fine.

2."Simple client" cannot find the advertised name of "basic_service" after leaving the program(I press the back button of my android and the android is back to the desktop). "Simple client" doesn't call foundAdvertisedName() anymore after close the "Simple Client".

Does anyone have the same issue?

UPDATE: After I set the TransportMask SERVICE_TRANSPORT_TYPE to TRANSPORT_TCP from TRANSPORT_ANY; The 1st issues is solved, but the 2nd issue sometime still shows up.

I don't understand the reason why setting of TransportMask does solve the issue because TRANSPORT_TCP should be included in TRANSPORT_ANY

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-12-19 09:10:04 -0700

georgen gravatar image

For the transport issue. When using TRANSPORT_ANY AllJoyn will try to use any transport available to ping the remote device. You case it tries to use the UDP Transport and fails printing the error message you reported. It then goes on to try other transports. Most likely the TCP Transport which works as you reported. If you use a mask to limit the transports then you will not try multiple transports so you will not see the failed connection attempts. For the second issue I am not sure whats going on I am looking at the code. Some of the code stops advertising a well-known name once discovered to save battery power. Initial inspection of the code did not show that the basic samples were canceling their name advertisements so I am not sure the source of that problem. Still looking.

edit flag offensive delete publish link more


Hi, georgen. I ported my alljoyn basic_sample to another linux embedded system and I find the 2nd issue solved. The 2nd issue happened when I am using virturalbox. Maybe that's some weird network settings make alljoyn advertsied not workable. Thanks for your explanation for 1st issue.

Blake.Chen ( 2014-12-21 17:57:01 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-12-03 17:30:54 -0700

Seen: 61 times

Last updated: Dec 03 '14