keithw/mosh — pull request #368 by andatche (2013-01-11 01:53:02+00:00)
Title: Don't keep sending state data to unresponsive clients

Don't continue sending state data or empty acks to the client if we haven't received a state update for more than 30 seconds.

This simple change prevents mosh-server from continuing to send UDP traffic to the last know client IP when the client becomes unresponsive, state updates are resumed when the client becomes responsive again. It saves unnecessary network traffic and prevents excessive battery-drain on mobile devices where the mosh client process can been killed/suspended silently in the background, but the server continues to send UDP traffic to the device. The traffic keeps the radio interfaces awake and the mobile device must waste time processing it. This affects the iSSH mosh implementation on iOS and causes significant battery drain, see https://groups.google.com/forum/?fromgroups=#!topic/issh/N42AM5LZO48