用户退出时,多加一种选择,停用session不清除session

This commit is contained in:
imhao183
2020-04-28 07:40:55 +08:00
parent 16deebb565
commit 739452830d
5 changed files with 26 additions and 10 deletions
@@ -109,11 +109,14 @@ public class ClientSession {
}
public void disconnect(boolean cleanSession) {
public void disconnect(boolean cleanSession, boolean disableSession) {
if (cleanSession) {
LOG.info("Client disconnected. Removing its subscriptions. ClientId={}", clientID);
// cleanup topic subscriptions
cleanSession();
} else if(disableSession) {
LOG.info("Client disconnected. disable session. ClientId={}", clientID);
m_sessionsStore.disableSession(this.clientID);
}
}