Interface ManagedPeerDataConnection

Abstraction layer over peerjs' data connection. It's supposed to be mockable in future.

Hierarchy

  • ManagedPeerDataConnection

Implemented by

Properties

close: (() => void)

Type declaration

    • (): void
    • Returns void

eventBus: Subscribable<ManagedPeerDataConnectionEvent>
send: ((data) => void)

Type declaration

    • (data): void
    • Sends provided JS data to remote target.

      It's also allowed to enqueue messages to send until connection is open.

      Note: this function works on best-effort basis. If close is called too fast, it may not send message it was requested to send. There is no way to "flush" it in WebRTC standard.

      In order to close connection properly(having all messages sent), make sure that last call is call to receiving function, so that both parties may exchange end of conn magics and close connection safely.

      Parameters

      • data: any

      Returns void

stateBus: StickySubscribable<ManagedPeerDataConnectionState>

Generated using TypeDoc