Thursday, August 27, 2009

Why do network applications still fail to handle sleep?

If I put a computer to sleep and then wake it, network-related applications generally try to pretend it didn't happen and then deal with the consequences. For example:
  • Thunderbird 2.x locks up for a while when I try to check my mail, and then starts working again.
  • Miranda IM shows a bunch of pointless alerts as if I lost network connectivity. These come from the KeepStatus add-on, which actually supports "Reconnect on APM resume".
  • Windows Live Messenger also acts as if I lost connectivity, waits a while to reconnect and then sometimes reconnects improperly, requiring another reconnect.
  • Putty loses the connection if the other side tried to send any data while the computer was sleeping. However, when the other side didn't try to send data an ssh connection can survive sleep. In this particular case, it might make sense to not add special suspend handling.
Sleep has been around for a long time. In Windows, the WM_POWERBROADCAST message was introduced in Windows 2000. Why not handle it and make the experience better for the user?

No comments: