support detecting connected devices through a heartbeat

TODO: Detect server disconnection.