gomobile-ipfs icon indicating copy to clipboard operation
gomobile-ipfs copied to clipboard

[gomobile-lib] adapt network configuration according to the connectivity

Open aeddi opened this issue 4 years ago • 1 comments

In the Berty app, we have developed a system to update the network configuration according to the device's connectivity, it is currently complicated to extract this part from our code to integrate it to gomobile-ipfs but we will deal with it as soon as possible.

Android and iOS offer APIs that allow the OS to notify your application when a connectivity change occurs: 4G, Wifi, Bluetooth, internet access, etc....

Depending on the new state, several things are conceivable to save resources (CPU, network, etc...). For example:

  • modify the different watermarks
  • disable the mDNS if we are not connected to a LAN
  • disable the reconnection attempt to bootstrap nodes (see bootstrapConfig) if there is no internet access, set the Period to 5 seconds if we are connected via a cellular connection and to 30 if we are connected via wifi
  • etc....

aeddi avatar Sep 19 '19 19:09 aeddi