Avoid to have unnecessary opened connections

This commit is contained in:
Marcos Lilljedahl
2017-07-31 10:10:48 -03:00
parent f82286d1d1
commit 3f4c96286e
2 changed files with 2 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ func WS(so socketio.Socket) {
session := core.SessionGet(sessionId) session := core.SessionGet(sessionId)
if session == nil { if session == nil {
log.Printf("Session with id [%s] does not exist!\n", sessionId) log.Printf("Session with id [%s] does not exist!\n", sessionId)
so.Disconnect()
return return
} }

View File

@@ -181,6 +181,7 @@
socket.on('session end', function() { socket.on('session end', function() {
$scope.showAlert('Session timed out!', 'Your session has expired and all of your instances have been deleted.', '#sessionEnd') $scope.showAlert('Session timed out!', 'Your session has expired and all of your instances have been deleted.', '#sessionEnd')
$scope.isAlive = false; $scope.isAlive = false;
socket.close();
}); });
socket.on('viewport', function(rows, cols) { socket.on('viewport', function(rows, cols) {