--To view this discussion on the web visit https://groups.google.com/d/msg/android-gcm/-/YxnCkaPRHRQJ.
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-gcm...@googlegroups.com.
How do we fix it? This particular case is not a bug with GCM, rather it is an over-zealous router. We found we could keep the connection alive with a ping every two minutes from the GCM server (which is free). There may be battery life implications for the device as I suspect the 15 minute timer that triggers the cooee is the same one you are supposed to align internal alarms with to minimize battery use.
Rolando
adb shell sqlite3 /data/data/com.google.android.gsf/databases/gservices.db "SELECT * FROM main WHERE name LIKE 'gtalk_%heartbeat_ping_interval_ms';"
adb shell sqlite3 /data/data/com.google.android.gsf/databases/gservices.db "UPDATE main SET value = 300000 WHERE name LIKE 'gtalk_%heartbeat_ping_interval_ms';"
Tom and Tomcat: Will try to address both your questions here:
I have two Android machines I use for testing:
An old HTC Incredible running 2.3.4 (I like testing on OLD devices….)
and a Samsung Galaxy Express running 4.0.4
If the delay problem is fixed in 4.1 that would be great. Tomcat: Can you confirm this with any other machines in addition to the one you mentioned??
I have made the migration from C2DM to GCM and never tested C2DM on my Samsung (4.0.4) machine.
The reason Google would do this intentionally is financial… The only way to establish the push channel is to have the device initiate the connection. The server cannot possibly know the ever-changing IP address of every device. Since the server has a fixed IP address and one or more well known ports, it is up to the device to create the connection. If every device maintains this connection while locked and unlocked, you can imagine the number of sockets that will need to be maintained on the server. My investigation indicates that the device in a locked state creates a new push connection every 10 minutes, with t=0 at the time the machine last entered the locked state. This has two effects: it randomizes the polling so that all the devices are not polling at the same time, and accounts for the fact that GCM push messages can go from 'instantaneous' if sent just before the poll occurs, to up to 10 minutes if the GSM push is sent just after the last poll, which means a given push should occur with a 5 minute delay on average. The benefits to Google are substantial since a given device spends a LOT more time in the locked state than in the unlocked state.
As for doing this ourselves, that really runs counter to what the Android platform should be doing for us. That would mean each of our apps would need to run as a daemon process consuming battery, and we would each need dedicated server sockets for every device registered. As I mentioned in the bug report, Apple iOS does this correctly and they pay the cost of the dedicated push connection in both locked and unlocked states.
This issue has nothing to do with WIFI or Cellular connections. The algorithm is the same: the device establishes the persistent socket connection periodically regardless. A side effect could be that in the absence of WIFI and with only a bad Cellular connection the poll will not occur, which would have the effect of delaying GSM pushes further.
Dave
Yes, I can read. Stills a Gtalk problem and you have no idea how GCM works.
Pedro Pagani Margarido
--
You received this message because you are subscribed to a topic in the Google Groups "android-gcm" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-gcm/Y33c9ib54jY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-gcm...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/d6e3b1f5-a1cb-45e7-baf7-7dce113c214f%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/CAKM0ai%3DRtbQtyMtmjXnUL4a791_BQQjG2qn9j8eN-2fxOwK2ag%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.