SignalingDevice.on() Overload 1

DESCRIPTION

Add listener for connection state changes.

DECLARATION

on(target: "connectionstatechange", f: () => void): void

PARAMETERS

target:
should be "connectionstatechange".
f:
the callback function to invoke.

Overload 2

DESCRIPTION

Add a listener invoked when the signaling connection reconnects.

DECLARATION

on(target: "connectionreconnect", f: () => void): void

PARAMETERS

target:
should be "connectionreconnect".
f:
the callback function to invoke.

Overload 3

DESCRIPTION

Add listener for errors.

Unlike the Nabto WebRTC Signaling Client, errors are not fatal in the signaling device. The device is created such that it retries in the case of an error.

The following known errors can occur:

  • ProductIdNotFoundError, if the Nabto WebRTC Signaling service does not know the provided productId.
  • DeviceIdNotFoundError, if the Nabto WebRTC Signaling service does not know the provided deviceId.
  • HttpError, if the Nabto WebRTC Signaling Service responds with a non 2xx error code, which is not handled by a more specific error.

DECLARATION

on(target: "error", f: (error: unknown) => void): void

PARAMETERS

target:
should be "error".
f:
the callback function to invoke.