mozilla-services / FindMyDevice

Find My Device - 🚨🚨This server is obsolete and unsupported.🚨🚨
Mozilla Public License 2.0
13 stars 8 forks source link

Attempt to keep websocket alive with empty frames #291

Closed nchapman closed 10 years ago

nchapman commented 10 years ago

Fixes #225.

@jrconlin, we had originally discussed just sending the tracking command more often, but I realized that won't actually help keep the socket alive if the device isn't responding. So, instead, I'm sending an empty websocket message every 45 seconds. It seems like the server is just ignoring them. I'm not sure it'll actually help keep the connection through the load balancer alive, but it seemed like the simplest solution. What do you think? Want to do something more formalized?

jrconlin commented 10 years ago

@nchapman I think sending a message every 45s should be fine, and yes, the server would ignore it. That should keep the connection open in any case.

Websocket is supposed to have an internal 1 byte heartbeat message, but not all clients deal with it correctly. Doing something at the app layer is ugly, but actually safer.

nchapman commented 10 years ago

Cool then let's roll with this then! @pdehaan will you peep the code with your special eyes?

jrconlin commented 10 years ago

special

pdehaan commented 10 years ago

LGTM, apart from those 2 questions/comments. If @jrconlin is happy, I'm happy.

Plus Travis is happy, which is... unheard of!