Details
-
Type: Improvement
-
Status: Closed
-
Priority: Default
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0.3
-
Component/s: None
-
Labels:None
Description
If the onLogout() callback is executed, it would be nice to know whether this was a normal logout,
ie the other side sent a "Logout" (and we responded to it), or whether we sent a Logout and got an answer.
I suggest to add the boolean variable receivedLogout with appropriate setter and getter methods to the SessionState:
public boolean isLogoutReceived()
public void setLogoutReceived(boolean logoutReceived)
The flag is cleared initially and set in nextLogout() to indicate that a Logout has been received (or sent). In the method
disconnect(), the flag is cleared after the call to the onLogout() callback.
A delegate method isLogoutReceived() is added to the Session object to make the current state accessible from outside.
Example usage:
public void onLogout(SessionID sessionID)
{ String disconnectDescription = ( session.receivedLogout() ? "Regular" : "Unsolicited" ); ... }