Re: [Standards] Whitespace "ping"

2019-06-16 Thread Ненахов Андрей
вт, 11 июн. 2019 г. в 19:26, Dave Cridland : > > I think the optimal ping, from the server's perspective, radically changes > depending on whether there are outstanding messages, and whether there's an > outstanding XEP-0198 ack. > > From a client's perspective it's really dependent on whether

Re: [Standards] Whitespace "ping"

2019-06-13 Thread Thilo Molitor
Dave's suggestions are more or less what I configured on my private server and are very sane imho: On my private server I'm using prosody and configured a TCP read timeout of 10 minutes and I'm using 0198 stream management (all my clients are gajim, monal, chatsecure or conversations). On TCP

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Florian Schmaus
On 11.06.19 16:25, Dave Cridland wrote: > I think the optimal ping, from the server's perspective, radically > changes depending on whether there are outstanding messages, and whether > there's an outstanding XEP-0198 ack. > > From a client's perspective it's really dependent on whether the user

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Dave Cridland
I think the optimal ping, from the server's perspective, radically changes depending on whether there are outstanding messages, and whether there's an outstanding XEP-0198 ack. >From a client's perspective it's really dependent on whether the user is active, and if not, whether there is a push

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Florian Schmaus
On 11.06.19 14:59, Marcel Waldvogel wrote: > On Tue, 2019-06-11 at 14:23 +0200, Mickaël Rémond wrote: >> Hello Guus, >> >>> On 11 Jun 2019, at 14:00, Guus der Kinderen >>> mailto:guus.der.kinde...@gmail.com>> wrote: >>> What we need basically is a way to negotiate the interval with server >>>

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Florian Schmaus
On 11.06.19 14:41, Philipp Hörist wrote: > Hi, > > So what is the best practice as a desktop client? As i also currently > review the whitespace sending code. > > Is every 10 seconds too much? I won't get much into the discussion about the interval, but you should at least not unconditionally

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Florian Schmaus
On 11.06.19 11:49, Mickaël Rémond wrote: > Hello, > > The RFC 6120 mentions whitespace ping to keep the connection alive and > help the server detects that the client is gone. > I also see that there was some attempt to bring consistency in the way > server handles this in XEP-0304: 

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Mickaël Rémond
Hello Marcel, > On 11 Jun 2019, at 14:59, Marcel Waldvogel > wrote: > > On Tue, 2019-06-11 at 14:23 +0200, Mickaël Rémond wrote: >> Hello Guus, >> >>> On 11 Jun 2019, at 14:00, Guus der Kinderen >> > wrote: >>> What we need basically is a way to

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Marcel Waldvogel
On Tue, 2019-06-11 at 14:23 +0200, Mickaël Rémond wrote: > Hello Guus, > > > On 11 Jun 2019, at 14:00, Guus der Kinderen < > > guus.der.kinde...@gmail.com> wrote: > > > > > What we need basically is a way to negotiate the interval with > > > server > > > > I'm not sure if this is _needed_?

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Sebastian Krzyszkowiak
2 minutes is still way to low. Mobile modems conserve energy the best while being in deep sleep - as soon as you wake the modem up, it drains hundreds/thousands times more energy for some amount of time. The timeout of 30 seconds wouldn't let some modems sleep at all, 2 minutes would most likely

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Philipp Hörist
Hi, So what is the best practice as a desktop client? As i also currently review the whitespace sending code. Is every 10 seconds too much? regards Philipp Am Di., 11. Juni 2019 um 14:38 Uhr schrieb Mickaël Rémond < mrem...@process-one.net>: > Thanks :) > I do not have a strong opinion

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Mickaël Rémond
Thanks :) I do not have a strong opinion regarding the "need", it was more a way to explain what I was trying to achieve with that idea. I am working on a client library these days and I am trying to be widely compliant and try to adapt to the server policy regarding whitespace keep-alive. I can

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Ненахов Андрей
вт, 11 июн. 2019 г. в 17:20, Guus der Kinderen : > Unless I'm mistaking, Push Notifications are one-way. As far as I know, they > can't be used to tell if a client has dropped offline (and do all kinds of > follow-up / cleanup actions, server sided). Push notifications are not meant to tell if

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Mickaël Rémond
Hello, Yes, I agree that push is the standard for battery saving. But Guus is right as push notification is used after the server has detected that the connection was lost. On the server, we must still detect the connection loss as fast as possible to clean-up and switch state. Cheers, --

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Guus der Kinderen
I'd have to check, but I think we're sending a IQ Ping when the client misses it's first white space ping interval (whatever we deem is appropriate in that server config), and define the client to be disconnected when it doesn't respond in a timely manner. This covers both of your "the client is

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Mickaël Rémond
Hello Guus, > On 11 Jun 2019, at 14:00, Guus der Kinderen > wrote: > > What we need basically is a way to negotiate the interval with server > > I'm not sure if this is _needed_? Without this being a requirement, much of > the complexity of "making this more standard" falls away. Well, I

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Guus der Kinderen
Yeah, I remember our then-CEO telling us that his phone "would not get warm anymore", after we changed the interval from 30 seconds to 2 minutes. That was over a decade ago though. I think that you're right in that patterns change with evolving mobile phone components. Unless I'm mistaking, Push

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Ненахов Андрей
Btw, from a mobile client developer perspective, if a server pings an app every 30 seconds, the battery drain is very high and is significantly higher than if interval is set to 2 minutes. What's interesting is that dependency is not linear: drain seems to rise sharply with intervals less than 60

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Guus der Kinderen
> > What we need basically is a way to negotiate the interval with server I'm not sure if this is _needed_? Without this being a requirement, much of the complexity of "making this more standard" falls away. A server could, before determining that a connection is lost, attempt to send any IQ

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Mickaël Rémond
Hello Marcel, > On 11 Jun 2019, at 13:28, Marcel Waldvogel > wrote: > > Why not just enable TCP keepalives? It is essentially a whitespace ping, > except it does not propagate to the application. As I understand it, TCP keepalives triggers after hours. The goal of whitespace keepalive is to

Re: [Standards] Whitespace "ping"

2019-06-11 Thread Marcel Waldvogel
Why not just enable TCP keepalives? It is essentially a whitespace ping, except it does not propagate to the application. If you need something at the application level, then do something at the XMPP level, such as stream management. On Tue, 2019-06-11 at 11:49 +0200, Mickaël Rémond wrote: >

[Standards] Whitespace "ping"

2019-06-11 Thread Mickaël Rémond
Hello, The RFC 6120 mentions whitespace ping to keep the connection alive and help the server detects that the client is gone. I also see that there was some attempt to bring consistency in the way server handles this in XEP-0304: https://xmpp.org/extensions/xep-0304.html