Class ConnectionManager

Hierarchy

Implements

Constructors

Properties

#private: any
configuredPubSubTopics: string[]
currentActiveDialCount: number = 0
dialAttemptsForPeer: Map<string, number> = ...
dialErrorsForPeer: Map<string, any> = ...
keepAliveManager: KeepAliveManager
libp2p: Libp2p
onEventHandlers: {
    peer:connect: ((evt) => void);
    peer:disconnect: (() => ((evt) => void));
    peer:discovery: ((evt) => void);
} = ...

Type declaration

  • peer:connect: ((evt) => void)
      • (evt): void
      • Parameters

        • evt: CustomEvent<PeerId>

        Returns void

  • peer:disconnect: (() => ((evt) => void))
      • (): ((evt) => void)
      • Returns ((evt) => void)

          • (evt): void
          • Parameters

            • evt: CustomEvent<PeerId>

            Returns void

  • peer:discovery: ((evt) => void)
      • (evt): void
      • Parameters

        • evt: CustomEvent<PeerInfo>

        Returns void

pendingPeerDialQueue: PeerId[] = []
instances: Map<string, ConnectionManager> = ...

Methods

  • Type Parameters

    Parameters

    • type: K
    • listener: null | EventHandler<IPeersByDiscoveryEvents[K]>
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • event: Event

    Returns boolean

  • Parameters

    • type: string

    Returns number

  • Type Parameters

    Parameters

    • type: K
    • Optional listener: null | EventHandler<IPeersByDiscoveryEvents[K]>
    • Optional options: boolean | EventListenerOptions

    Returns void

  • Type Parameters

    • Detail

    Parameters

    Returns boolean

  • Checks if the peer is dialable based on the following conditions:

    1. If the peer is a bootstrap peer, it is only dialable if the number of current bootstrap connections is less than the max allowed.
    2. If the peer is not a bootstrap peer

    Parameters

    • peerId: PeerId

    Returns Promise<boolean>

Generated using TypeDoc