Touch session on web socket ping/pong.

This commit is contained in:
Martin Edenhofer 2014-07-13 23:42:36 +02:00
parent 014ff4bda2
commit 335f6fa42b

View file

@ -175,6 +175,7 @@ EventMachine.run {
# remember ping, send pong back # remember ping, send pong back
elsif data['action'] == 'ping' elsif data['action'] == 'ping'
Sessions.touch(client_id)
@clients[client_id][:last_ping] = Time.now @clients[client_id][:last_ping] = Time.now
@clients[client_id][:websocket].send( '[{"action":"pong"}]' ) @clients[client_id][:websocket].send( '[{"action":"pong"}]' )