This model manages all connections including pairing scenarios etc.

The lower levels handle the complete connection establishment based on information found in Leute. This module just executes the correct protocol when a connection was established (e.g. the chum, or the pairing protocol ...)

Pairing: Pairing is handled by the PairingManager that can be accessed by ".pairing" on this module.

Hierarchy (view full)

Constructors

Properties

onConnectionsChange: OEvent<(() => void)> = ...

Event is emitted when a connection is established or closed.

onOnlineStateChange: OEvent<((state: boolean) => void)> = ...

Event is emitted when state of the connector changes. The emitted value represents the updated state.

onProtocolStart: OEvent<((initiatedLocally: boolean, localPersonId: SHA256IdHash<Person>, localInstanceId: SHA256IdHash<Instance>, remotePersonId: SHA256IdHash<Person>, remoteInstanceId: SHA256IdHash<Instance>, protocol: Protocols) => void)> = ...

Event is emitted when the chum starts.

onUpdated: OEvent<(() => void)> = ...
pairing: default
state: StateMachine<"Uninitialised" | "Initialised", "shutdown" | "init">

Accessors

  • get onlineState(): boolean
  • Retrieve the online state based on connections to comm servers.

    If we don't have connections to comm servers, the state will always be true.

    Returns boolean

Methods

  • Dumps all information about connections and routes in readable form to console.

    Parameters

    • header: string = ''

    Returns void

  • Disable all connections to this instance.

    Parameters

    • remoteInstanceId: SHA256IdHash<Instance>
    • OptionallocalPersonId: SHA256IdHash<Person>

      If specified only the connections originating from this person are affected.

    Returns Promise<void>

  • Disable all connections to this person.

    Parameters

    • remotePersonId: SHA256IdHash<Person>
    • OptionallocalPersonId: SHA256IdHash<Person>

      If specified only the connections originating from this person are affected.

    Returns Promise<void>

  • Enable all connections to this instance.

    Parameters

    • remoteInstanceId: SHA256IdHash<Instance>
    • OptionallocalPersonId: SHA256IdHash<Person>

      If specified only the connections originating from this person are affected.

    Returns Promise<void>

  • Enable all connections to this person.

    Parameters

    • remotePersonId: SHA256IdHash<Person>
    • OptionallocalPersonId: SHA256IdHash<Person>

      If specified only the connections originating from this person are affected.

    Returns Promise<void>