Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smacks keepalive ping #53

Closed
tmolitor-stud-tu opened this issue Oct 7, 2016 · 7 comments
Closed

Smacks keepalive ping #53

tmolitor-stud-tu opened this issue Oct 7, 2016 · 7 comments

Comments

@tmolitor-stud-tu
Copy link
Member

Currently Monal doesn't seem to do some sort of keepalive ping and I have to configure my prosody server to send out smacks pings (r-tags) after 7 minutes of inactivity to keep the connection alive.

If I don't do this my mobile carrier closes the TCP connection after some time (approximately 10-15 minutes) and Monal gets disconnected.

Sending an r-tag every 5 minutes or so (that is the interval Conversation uses for this) would solve this issue. For non-smacks sessions you could send a ping stanza to get the same result.

This could be connected to issue #3 I think.

@tmolitor-stud-tu
Copy link
Member Author

I just looked at the code and saw you already implemented this (smacks ping and regular ping if smacks isn't available and even whitespace ping if ping isn't available :) )

But: could you lower the ping timeout to 5 minutes? Currently it is set to 10 minutes, which is far too long for some mobile carriers here :(

@anurodhp
Copy link
Contributor

the rough 10 minute ping when in the background is an apple thing. I can probably add a setting to allow the user to adjust the ping when in the foreground but i suspect that will not do you a lot of good since it will likely disconnect eventually in the background.

@tmolitor-stud-tu
Copy link
Member Author

well, such a setting would at least prevent it to get disconnected when in foreground.
But to get this right: apple prevents pings shorter than 10 minutes?

@nogweii
Copy link

nogweii commented Apr 28, 2017

This isn't exactly related, but Android 7.0+ is also moving to aggressively limit background data usage. I believe Google's recommended default setting is only allowing background apps to synchronize once every 15 minutes.

It seems like it's probable that Apple has indeed limited it to no more than once every 10 minutes.

@tmolitor-stud-tu
Copy link
Member Author

That's not fully correct.
As far as I know background data is only limited in doze mode which is activated when the device isn't moved and the display turned off for a ceratin amount of time.

See this for a good explanation: https://developer.android.com/training/monitoring-device-state/doze-standby.html

In the emulator I observed Monal is successfully pinging every minute while in background.

@anurodhp
Copy link
Contributor

anurodhp commented Jan 7, 2018

I think the smacks changes and the adoption of push should let us close this.

@anurodhp anurodhp closed this as completed Jan 7, 2018
@tmolitor-stud-tu
Copy link
Member Author

Yes, I think so :)
After I revised the complete smacks implementation everything worked as intended (at least in the simulator).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants