0

How to get the alive status of a ControlPanel device in quickly? (alljoyn 14.02)

asked 2015-01-31 19:20:07 -0700

StannisLin gravatar image

updated 2015-02-02 16:06:50 -0700

Hi,

I found out that the AllSeen ControlPanel device (the device) will keep alive and response at the AllSeen router (the router) even though the device already shut down and power off.

I called it dead body. (zombie?)

Now, in my ControlPanelController App (the App), I used a timed out trick to decide the device is dead or alive. That is because the response time of a dead body will lag over 30+ seconds.

By the way, the SessionLost signal of each dead body will lag over 5+ minutes.

How to get the alive status of a ControlPanel device in quickly by AllSeen framework API? (alljoyn 14.02)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-05-02 20:08:48 -0700

praveenb gravatar image

Release 14.06 has added support for a Presence API, precisely for the purpose of finding the status of the remote application. The best course of action is to upgrade all applications to AllJoyn 14.06 or newer, if feasible.

Having said that, there are a couple of ways in which one can check the status of the remote application in 14.02 as well.

One reliable option is to use ajn::BusAttachment::SetLinkTimeout(SessionId sessionid, uint32_t& linkTimeout). After forming a session with the remote application, set a link timeout on the session. This causes periodic heartbeat messages to be exchanged between routing nodes and one can detect that the remote application has gone away (i.e. zombie as you termed) in 40 seconds (instead of lag over 5+ minutes).

A second option is to invoke CancelFindAdvertisedName on the local application, followed by invoking FindAdvertisedName for a name expected to be advertised by the remote application. When a fresh FindAdvertisedName query is issued and no FoundAdvertisedName was received with a certain timeout of your choice, you can consider the remote application to be a zombie. Because UDP multicast is involved in Discovery, this option is slightly less reliable than the previous option involving sessions (which are done over a reliable transport).

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

Question Tools

Follow
1 follower

Stats

Asked: 2015-01-31 19:20:07 -0700

Seen: 230 times

Last updated: May 02 '15