connect method

Future<void> connect({
  1. Iterable<String> urls = DEFAULT_BOOTSTRAP_RELAYS,
})

This will initialize the manager with bootstrap relays. If you don't give any, will use some predefined

Implementation

Future<void> connect(
    {Iterable<String> urls = DEFAULT_BOOTSTRAP_RELAYS}) async {
  bootstrapRelays = [];
  for (String url in urls) {
    String? clean = cleanRelayUrl(url);
    if (clean != null) {
      bootstrapRelays.add(clean);
    }
  }
  if (bootstrapRelays.isEmpty) {
    bootstrapRelays = DEFAULT_BOOTSTRAP_RELAYS;
  }
  await Future.wait(
          urls.map((url) => reconnectRelay(url, force: true)).toList())
      .whenComplete(() {
    if (!_seedRelaysCompleter.isCompleted) {
      _seedRelaysCompleter.complete();
    }
  });
}