directConnect method

Future<void> directConnect(
  1. PeerId peerId
)

Attempts to make a direct connection with a remote peer. It first attempts a direct dial (if we have a public address of that peer), and then coordinates a hole punch over the given relay connection.

Implementation

Future<void> directConnect(PeerId peerId) async {
  try {
    await _beginDirectConnect(peerId);
    await _directConnect(peerId);
  } finally {
    await _activeMutex.synchronized(() {
      _active.remove(peerId);
    });
  }
}