if data transfer take long time, client with buslistener would call lostAdvertisedName

asked 2014-05-21 23:56:28 -0700

europelee gravatar image

updated 2014-05-22 02:58:29 -0700

  1. 1.1 if data transfer take long time, client with buslistener would call lostAdvertisedName, transfer by session-signal.
    and when client call lostAdvertisedName, i find service still have session, never lost, because in my code, service have SessionListener(sessionLost, sessionMemberAdded, sessionMemberRemoved), but service never call them.

1.2 I already fix it, add check ALLJOYN_JOINSESSION_REPLY_ALREADY_JOINED when joinsession, lostAdvertisedName look like nothing effect, can i igore it?
because i find when lostAdvertisedName called, client spend long time to found again and join session, it is bad, how deal with the case, such as when lostAdvertisedName called, client could call
findAdvertisedName , and this can let client quickly found again and join session?

  1. i don't understand, there busattachment has function setLinkTimeout, but my code not call it. for client: buslistener-lostAdvertisedName vs SessionListener-sessionLost, their relationship? someone can help to explain it? thanks!
edit retag flag offensive close merge delete


Can you please provide a little more context on your use case and the problem you are running into, including the SDK you are using, platform you are running on, etc. Also, if possible, posting all or part of your code would help.

mitchw ( 2014-05-22 13:37:48 -0700 )edit

Can you also clarify "data transfer", I assume this is a BusMethod call? You may want to change the logic to a Signal as that would be more efficient. Signals will arrive in the order they are sent (unless you thread the sending) and as long as you are in a Session they are guaranteed delivery. No need for a response.

bspencer ( 2014-05-22 14:37:27 -0700 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2014-05-27 10:23:43 -0700

mitchw gravatar image

If your primary use case is streaming audio between 2 Android applications, I would recommend using the AllJoyn Audio Service (https://allseenalliance.org/docs-and-downloads/documentation/getting-started-alljoyn-audio-service-framework-10-android)

edit flag offensive delete publish link more

answered 2014-05-22 13:36:24 -0700

mitchw gravatar image

Difference between LostAdvertisedName and SessionLost:

  • The LostAdvertisedName callback in a BusListener is called when the corresponding advertisement is considered lost by AllJoyn. This could mean that the application originally advertising the name has stopped advertising, a loss of connectivity, network issues, etc.
  • The SessionLost callback in a SessionListener is called when the session that the listener was registered with is considered lost by AllJoyn. This could happen for a number of reasons, including the application hosting the session closing the session, the application hosting the session quitting, loss of connectivity between applications in the session, etc.
edit flag offensive delete publish link more


hi, I use 14.02, and alljoyn-android java, my case is : a service app A, a client app B, and A push audio file to B by session-signal, while B would recv, and at the same time playing music(B has a BusSignalHandler for recving bytes sent from A, then save bytes into a mkfifo pipe) my code has another thread for playing music read bytes from the mkfifo pipe, I guess because of alljoyn thread often block on my BusSignalHandler function for saving bytes into pipe, it lead to alljoyn call LostAdvertisedName, what trigger LostAdvertisedName called in alljoyn code, depend time count?

europelee ( 2014-05-22 19:12:46 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-05-21 23:56:28 -0700

Seen: 173 times

Last updated: May 22 '14