Faster Notification of Disconnections / SessionLost

asked 2014-09-16 13:48:38 -0700

cs_chance gravatar image

I am building a program via AllJoyn, where I expect a fairly high rate of nodes joining and leaving the network with no fore notice (e.g., no explicit disconnection called). My understanding is that I can notify the server a client has dropped via a session listener and then take the appropriate action (is this correct?).

What I've read elsewhere is that it may take up to 60 seconds for the session to be recognized as lost. My question is, is there anyway to decrease the amount of time a server will wait before it declares that the session has been lost?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-09-16 14:06:27 -0700

Nikhil Dabhade gravatar image

updated 2014-09-16 14:07:14 -0700

Hi cs_chance,

  1. There is no explicit disconnect in your case.
  2. The server needs to be notified of a client which has left.
  3. You are right in your understanding of session listener

Some background: I am not sure what version of AllJoyn are you using but I will try and answer it with the latest version 14.06 Traditionally, the two ways to get notified of a client having left a session was:
1. Make a method call over a session on the client over a periodic time so that if the client is not present we get a node not present error.
2. Rely on SetLinkTimeout which is like a probe having a minimum value of 40 secs. If you were in a session with the client and weren't making any periodic method calls or method calls in general then after the time specified in SetLinkTimeout a probe is sent out which detects if the connection to the client is still up.

The faster among the two methods is obviously the first one because you get an instant reply about a peer being present or is disconnected from a session.

14.06 introduced NGNS (Next generation name service) which gives the developer the ability to ping a peer and check for its presence without being tied to a session but in your case it seems like you are in a session always.

You could call the Ping method on org.alljoyn.Peer interface and get an instantaneous reply for its presence in a reliable manner.

A session lost is triggered when all of the peers in the session have gone way. If you had called a SetLinkTimeout then that value should be honored to detect if the last peer has gone away.

Let me know if something is not clear.


edit flag offensive delete publish link more


Thanks a lot!

cs_chance ( 2014-09-17 07:50:36 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-09-16 13:48:38 -0700

Seen: 297 times

Last updated: Sep 16 '14