Google App Engine: Permanent browser-server connection

I played with the Google App Engine channel APIs to create a real-time multiplayer game similar to http://rawkets.com/ . Since this API is basically "one way" (it doesn’t allow you to maintain a constant connection between the servers), I just issue new AJAX POST (JQuery) requests in about 30 seconds.

It seems to be creating a lot of overhead (5-6kbps), which I would like to reduce if possible. Ideally, I would like to create only one connection, which lasts a little less than 30 seconds (application request timeout) and continues to send fresh data every 30 milliseconds for the entire duration of the connection. The server will then use the channel API to “spread the word” to all other relevant clients. Hope this makes sense!

Any ideas?

+3
source share
3 answers

There are two main problems with creating long-lived connections.

sje397, API - . , , .

30 ? , memcache . , , , .

+1

, API ( , - ).

, "" -. , http://pusherapp.com.

0

, HTTP - , API- () -, App Engine.

However, 30 requests per second per client seems particularly absurdly high - no keyboard user can generate many events.

0
source

Source: https://habr.com/ru/post/1781091/


All Articles