0

sessionLost/onDeviceLost is never called

asked 2014-08-25 21:38:47 -0800

qieman gravatar image

I run an about client app and an about server app in a same android phone, and the 2 apps communicate well. However, when I quit the server app, the client app doesn't call AnnounceHandler.onDeviceLost() or sessionListener.sessionLost(). The server app has invoke AboutService.StopAboutServer(), BusAttachment.cancelAdvertiseName() and BusAttachment.disconnect() before quiting.

edit retag flag offensive close merge delete

Comments

Hi qieman, Do you have an active session between the two apps ? If you just got an announce signal from the server app and you had not done a join session on the client app then they are not in a session.

Nikhil Dabhade ( 2014-08-26 10:54:29 -0800 )edit

I have done a joinSession in the client and it returns OK, but when I debug I find the session id is 0. Doesn't session id 0 means sessionless?

qieman ( 2014-08-26 17:35:54 -0800 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-10-31 09:35:16 -0800

georgen gravatar image

updated 2014-10-31 09:35:57 -0800

if the session id is 0 then you are not in a session. Programs connected to the same routing node can talk with each other even if they are not in a session. If you want to talk device to device you really want to be in a session. Since the AnnounceHandler.onDeviceLost relies on the sessionLost signal. I would focus on figuring out why you are not getting a session id.

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

Question Tools

Follow
1 follower

Stats

Asked: 2014-08-25 21:38:47 -0800

Seen: 74 times

Last updated: Aug 25 '14