Close our connections to a peer
Optional
options: AbortOptionsReturn connections, optionally filtering by a PeerId
Optional
peerId: PeerIdconst connections = libp2p.connectionManager.get(peerId)
// []
Return a map of all connections with their associated PeerIds
const connectionsMap = libp2p.connectionManager.getConnectionsMap()
Return the list of in-progress or queued dials
const dials = libp2p.connectionManager.getDialQueue()
Given the current node configuration, returns a promise of true
or
false
if the node would attempt to dial the passed multiaddr.
This means a relevant transport is configured, and the connection gater would not block the dial attempt.
This may involve resolving DNS addresses so you should pass an AbortSignal.
Optional
options: IsDialableOptionsOpen a connection to a remote peer
Optional
options: OpenConnectionOptionsconst connection = await libp2p.connectionManager.openConnection(peerId)
Invoked after an incoming connection is opened but before PeerIds are exchanged, this lets the ConnectionManager check we have sufficient resources to accept the connection in which case it will return true, otherwise it will return false.