Leave a self-joined session

88 Views Asked by At

I understood by reading the source code that the method leaveSession of the BusAttachment can't be called on a self-joined session. So, how to leave a self-joined session?

2

There are 2 best solutions below

0
On

Does the call fail? This may be an issue where the documentation is inconsistent with the code. The Java bindings merely call the C++ code, and the C++ code doesn't appear to have a problem leaving self-joined sessions.

0
On

I was also having a problem when using the leaveSession method. The error I get from the bus is:

ER_ALLJOYN_LEAVESESSION_REPLY_NO_SESSION

However, when I use the leaveHostedSession, the host leaves the session with success.

Mind that the session lost event will not be fired at the clients if more than one client remains in the session.