         sock.name        = name
         sock._h          = undefined
         sock._timeout    = undefined
+        sock._nextPing   = undefined
         sock.onmessage   = (message) ->
             that.onmessage @, message
         sock.onclose     = () ->
             that.close @
         @send sock, { type : 'authenticated' }
-        setTimeout (() =>
+        sock._nextPing   = setTimeout (() =>
             @sendPing sock
         ), 60000
         if not @socks[rid]?

        @socks[rid][uid] = sock

    close : (sock, reason = 'Session closed') =>
        delete @socks[sock.rid][sock.uid]
        for uid of @socks[sock.rid]
            if @socks[sock.rid][uid]?

            when 'pong' then do () =>
                if message.params.token is sock._h
                    clearTimeout sock._timeout
                    sock._timeout  = undefined
                    sock._h        = undefined
                    sock._nextPing = setTimeout (() =>
                        @sendPing sock
                    ), 60000

