0

I'm writing a p2p chess game that sends 2 byte messages back and forth (e.g. e4 or c4). I'm considering the use of GAE Channel API. I noticed that this API causes the browser to send a heartbeat message to the server with POST URL https://849.talkgadget.google.com/talkgadget/dch/bind?VER=8&clid=...

That fires about every second. I won't be charged for the response data and response headers for those heartbeat requests correct?

Also, when I send data from the server to a browser over a channel, am I charged for only the json string itself or all http header/payload packets?

Lightbeard
  • 4,011
  • 10
  • 49
  • 59

1 Answers1

1

Google has a newer (and totally free!) API you should look at instead of the channel API (unless its restrictions cant be worked arround.)

GCM (google cloud messaging) is free, with a few restrictions like packet size (2kb in some cases) but it will handle everything for you (queuing, broadcast to all, broadcast to topics, one-to-one messaging, battery-efficient mobile libraries (android and iOS), native chrome support etc.

https://developers.google.com/cloud-messaging/ Make sure to also see this s.o. answer for GCM implementation tips: https://stackoverflow.com/a/31848496/2213940

Community
  • 1
  • 1
Zig Mandel
  • 19,571
  • 5
  • 26
  • 36
  • Thanks again Zig. I may very well use this API. I think the original question is still relevant at least to some though because all major browsers are supported by the javascript Channel API - not just Chrome. I realize most users can be reached using GCM via an iOS app in combination with native Chrome, but then two different application implementations are needed – Lightbeard Aug 07 '15 at 20:41
  • with GCM you have the same server code for any client (iOS, android, chrome). Channel api has less restrictions but does not handle queuing or broadcast, but in your case for 1on1 it doesnt matter to you. – Zig Mandel Aug 07 '15 at 21:00