> 2014-03-13 8:46 GMT+01:00 Roberto De Ioris <[email protected]>:
>
>>
>> Nope, and i really would like some form for of ping/pong starting from
>> the
>> client :(
>>
>
> So, this means, that my assumption was correct, that its a browser issue.
>
>
>> Currently (in 20tab, for gaming) we have started sending "heartbeats"
>> from
>> the server and instructed the client to close the connection if it does
>> not receive one in the expected timeout. I think it is the only way to
>> be
>> sure you are still playing with the others :)
>>
>> Ok, then I will implement something similar. How do you tag such a
> "heartbeat" package, so that one can immediately distinguish it from
> normal
> payload?
> _______________________________________________
>

I am using a binary protocol for games, the "first" byte of each packet
identify the type of message (like go north, go south, shoot...), we have
added the "i_am_alive" message, and every time we receive it we update a
global timestamp.

Then a javascript timer check the value of this timestamp, if it is older
than X (generally 30 seconds) we close the websocket and end the game.


-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to