code: function ensureConnected(remote, callback) {
    if (remote.getServer()) {
      callback(null, isConnected(remote));
    } else {
      callback(null, false);
    }
  }
docs: Check if remote is connected and attempt to reconnect if not
  
  @param {Remote} remote
  @param {Function} callback