Revision history [back]

click to hide/show revision 1
initial version

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 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.

Update

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.