Add session keep alive. If client doesn't send a keep alive, after a

specified amount of time the scheduler closes the session
This commit is contained in:
Jonathan Leibiusky (@xetorthio)
2017-10-16 18:11:15 +02:00
parent 8769aa344a
commit 1b0d363ffe
5 changed files with 43 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/googollee/go-socket.io"
"github.com/gorilla/mux"
"github.com/play-with-docker/play-with-docker/event"
)
func WS(so socketio.Socket) {
@@ -65,6 +66,10 @@ func WS(so socketio.Socket) {
m.Close()
core.ClientClose(client)
})
so.On("session keep alive", func() {
e.Emit(event.SESSION_KEEP_ALIVE, sessionId)
})
}
func WSError(so socketio.Socket) {