tomp2p/TomP2P — pull request #66 by nicoruti (2014-11-14 15:31:08+00:00)
Title: External GCM Server + Slow peer timeout

This pull request includes further improvements for TomP2P on the Android phone. In short, the following changes are included:
- Requests to slow peer time out (by default after 60s, configurable) if the slow peer does not answer. In the previous version, awaitUninterruptibly never finished if a slow peer did not receive the request.
- GCM authentication key (obtained at the Google Console) is only known by the relay peers with GCM functionality. Previously, the mobile phone did send the key to the relay peer. This design change is based on the fact that an Android app could be decompiled and the key would be visible in plain-text.
- Support for dedicated GCM senders: Not every relay peer serving an Android device needs to know the GCM authentication key. Instead, the mobile phone can send a list of known / trusted GCM peers to the relay. If the relay wants to notify the mobile device over GCM, it contacts one of these peers.
- Builder pattern for the relay configuration (Android, TCP, timeouts, manualRelays, etc.). Some configuration stuff from the PeerNATBuilder has been cleaned up and moved into the RelayConfig.