Added logic to suppress failing callbacks to users that lost connection.

This commit is contained in:
LevelX2 2018-01-28 18:05:43 +01:00
parent 34a884546a
commit 7f17011bf0
2 changed files with 18 additions and 29 deletions

View file

@ -125,6 +125,7 @@ public enum SessionManager {
public void disconnect(String sessionId, DisconnectReason reason) {
Session session = sessions.get(sessionId);
if (session != null) {
boolean lockWasSet = session.setLock();
if (!sessions.containsKey(sessionId)) {
// session was removed meanwhile by another thread so we can return
return;
@ -148,7 +149,9 @@ public enum SessionManager {
default:
logger.trace("endSession: unexpected reason " + reason.toString() + " - sessionId: " + sessionId);
}
if (lockWasSet) {
session.unlock();
}
}
}