Hierarchy

  • ConnectionManager

Properties

acceptIncomingConnection: ((maConn: MultiaddrConnection) => Promise<boolean>)

Type declaration

    • (maConn: MultiaddrConnection): Promise<boolean>
    • 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.

      Parameters

      Returns Promise<boolean>

afterUpgradeInbound: (() => void)

Type declaration

    • (): void
    • Invoked after upgrading a multiaddr connection has finished

      Returns void

closeConnections: ((peer: PeerId) => Promise<void>)

Type declaration

getConnections: ((peerId?: PeerId) => Connection[])

Type declaration

    • (peerId?: PeerId): Connection[]
    • Return connections, optionally filtering by a PeerId

      Example

      const connections = libp2p.connectionManager.get(peerId)
      // []

      Parameters

      Returns Connection[]

getConnectionsMap: (() => PeerMap<Connection[]>)

Type declaration

    • (): PeerMap<Connection[]>
    • Return a map of all connections with their associated PeerIds

      Example

      const connectionsMap = libp2p.connectionManager.getConnectionsMap()
      

      Returns PeerMap<Connection[]>

getDialQueue: (() => PendingDial[])

Type declaration

    • (): PendingDial[]
    • Return the list of in-progress or queued dials

      Example

      const dials = libp2p.connectionManager.getDialQueue()
      

      Returns PendingDial[]

openConnection: ((peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions) => Promise<Connection>)

Type declaration