connection close between AJTCL and AllJoyn router

asked 2015-10-15 23:03:48 -0700

DanielFeng gravatar image

Hi all,

The AJTCL can invoke the SetBusLinkTimeout() API to detect connectivity failures with the AllJoyn router.

Does the AllJoyn router can active to tell the AJTCL the router will be closed?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-10-16 00:22:06 -0700

praveenb gravatar image

updated 2015-10-16 13:53:58 -0700

The API AJ_SetBusLinkTimeout is used in conjunction with AJ_NotifyLinkActive and AJ_BusLinkStateProc to detect whether the TCP connection between the thin leaf node and the routing node is still active. The underlying mechanism is to send probe packets and timeout if three such probes are unanswered by the routing node.

TCP stack implementations have their own timeout (a few minutes) to determine whether the remote peer has gone away before returning socket errors (based on which applications can take appropriate action). To provide a means of quicker detection, the above mentioned APIs are used.

In 15.09, a new transport, ARDP, is made available for Thin Library. ARDP is a reliability layer on top of UDP and has some useful features, one of which is quick link loss detection. When using the ARDP transport, it is not necessary to use the AJ_SetBusLinkTimeout. ARDP will detect the inactive link more quickly (about 30 seconds) and return an error that is passed back to the application.


The signal SessionLost is sent by the routing node (which handles session management) when one of the peers in the session leaves/exits. However, when the routing node itself is going down (SIGINT sent to alljoyn-daemon or Android app being exited in your case), there isn't enough time to notify all concerned parties about this. Hence, SessionLost isn't sent to the leaf nodes.

Nevertheless, irrespective of TCP/ARDP in use, the thin leaf node will get a socket error which will indicate that the connection to routing node is no longer present. The time it takes to get the socket error depends on TCP / ARDP as described above.

edit flag offensive delete publish link more


we use control panel APK(bundle router) to interactive with the AJTCL. When APK be closed on unexpected the tcp socket will be closed immediately. In 14.06, does the router can send some message(like LeaveSession) for AJTCL to indicate the router will be closed?

DanielFeng ( 2015-10-16 01:09:39 -0700 )edit

Updated the answer to address your question. Also wanted to indicate that the latest release from AllSeen Alliance is 15.09. 14.06 is three releases old.

praveenb ( 2015-10-16 13:55:19 -0700 )edit

Thanks for your reply!

DanielFeng ( 2015-10-18 17:49:55 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-10-15 23:03:48 -0700

Seen: 92 times

Last updated: Oct 16 '15