Future connect()

Source

Future connect() {
  Future run() {
    link.connect();
    return link.onConnected;
  }

  if (!_initCalled) {
    return init().then((_) => run());
  } else {
    return run();
  }
}