News for hackers. Stuff that matters.
Re:XMPP Myths by ape4 on Tuesday August 11, 2015 @08:26AM (#10040450)
> absence of push

If you are connected and your buddy sends a message you get it right away.

Re:XMPP Myths by niklasni1 on Tuesday August 11, 2015 @08:28AM (#10040464)
On mobile you want messages to come through without each app maintaining a connection.
Re:XMPP Myths by emias on Tuesday August 11, 2015 @08:37AM (#10040511)
Because?
Re:XMPP Myths by rakoo on Tuesday August 11, 2015 @08:43AM (#10040549)
Because iOS doesn't let you do that (see http://op-co.de/blog/posts/mobile_xmpp_in_2014/#index6h2)
Re:XMPP Myths by pjc50 on Tuesday August 11, 2015 @08:47AM (#10040565)
This is the real answer - long-standing connections are banned by the platform monopolist - and should be much closer to the top.
Re:XMPP Myths by emias on Tuesday August 11, 2015 @08:48AM (#10040568)
Yes, but I think the claim was that a persistent TCP connection has a negative effect on battery life, which is not obvious to me. An idle connection should have no impact whatsoever.
Re:XMPP Myths by joepie91_ on Tuesday August 11, 2015 @08:39AM (#10040523)
Because TCP connections are expensive on your battery life. Especially if your network is flaky, and all those connections need to constantly repeat their handshakes.
Re:XMPP Myths by ultramancool on Tuesday August 11, 2015 @08:40AM (#10040532)
Not really, TCP connections are how GCM does things even. Unless you're using keep alives or otherwise preventing sleep, I believe these devices are capable of sending an interrupt when there's activity on a network connection though I could be mistaken.
Re:XMPP Myths by Flowdalic on Tuesday August 11, 2015 @08:47AM (#10040564)
Idle TCP connections do not consume any battery.

And on a data connectivity change, e.g. GSM <-> WiFi switch, there is a good chance that a dozen other components start trying to re-establish their connections, which means the radio is awake anyway (for, usually, at most a few seconds).

Re:XMPP Myths by rakoo on Tuesday August 11, 2015 @09:07AM (#10040687)
> Idle TCP connections do not consume any battery.

An idle connection doesn't consume anything, but a useful idle connection will have some keepalive every X minutes. Multiply that by the number of connections your application will have and by the number of background application you run on your phone, and the radio will never truly sleep or enter the "low" mode. The solution wanted by Google and Apple is to maintain a single connection to their server on which every push is aggregated and sent, and that the OS itself manages.

Re:XMPP Myths by Flowdalic on Tuesday August 11, 2015 @09:26AM (#10040826)
I use my mobile XMPP connections without a TCP keepalive but send a server ping if there has been stanzas received in the last 30 minutes and get a useful and reliable XMPP connection without a noticeable impact on battery. If you use Android's AlarmManager to trigger the check, then Android will even take care of scheduling the "alarm" with other alarms for efficiency.

> Multiply that by the number of connections your application will have and by the number of background application you run on your phone, and the radio will never truly sleep or enter the "low" mode.

Why would X x Y idle connections (X: TCP connections per app, Y: applictions) prevent your radio from sleeping?

Re:XMPP Myths by rakoo on Tuesday August 11, 2015 @10:51AM (#10041460)
> Why would X x Y idle connections (X: TCP connections per app, Y: applictions) prevent your radio from sleeping?

In the worst case, if the pings aren't sent at the same moment and all applications have a timeout set to, let's say, 30 minutes, your phone will send a ping every 30/(X*Y) minutes. I don't know what the usual X and Y would be, but if they're high enough your radio will always be up (check out these slides, 23 in particular: https://www.igvita.com/slides/2013/io-radio-performance.pdf)

And that's only counting idle applications. If you have one that periodically polls a server, it gets even worse.

Re:XMPP Myths by Flowdalic on Tuesday August 11, 2015 @11:18AM (#10041687)
Course, you shouldn't poll and if those mechanisms aren't coordinated, then you you will suffer. But that's why Android provides the AlarmManager API and I would expect other mobile platforms to provide something similar.