Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Connection

Interface for sending and receiving messages with a client.

Hierarchy

  • Connection

Implemented by

Index

Properties

Methods

Properties

promises

promises: object

Type declaration

  • [id: string]: QueuedPromise

quality

quality: ConnectionQuality

Methods

close

  • close(): void

off

  • off(event: "send" | "recv", listener: function): void
  • off(event: "close", listener: function): void
  • off(event: "error", listener: function): void

on

  • on(event: "send" | "recv", listener: function): void
  • on(event: "close", listener: function): void
  • on(event: "error", listener: function): void
  • Registers a handler for the 'send' or 'recv' events. Called when a new message is to be sent.

    Parameters

    • event: "send" | "recv"
    • listener: function
        • (message: Message): void
        • Parameters

          • message: Message

          Returns void

    Returns void

  • Registers a handler for the 'close' event. Called when the connection was closed.

    Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns void

  • Registers a handler for the 'error' event. Called when the connection experiences an error.

    Parameters

    • event: "error"
    • listener: function
        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns void

recv

  • recv(message: Message): void

send

  • send(message: Message): void