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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user