@yoshteq/ti365-ts-sdk
    Preparing search index...

    Class TlsMultiplexedWebSocketConnection

    An WebSocket Provider hat allows to tunnel multiple connections though one WebSocket connection, by splitting the Transmissions in Multiple Channels.

    In order for this to work, there is an special Backend required.

    For a Simple TCP <> WebSocket bridge, see TlsNativeWebSocketProvider

    Index

    Constructors

    Properties

    websocketUrl: string
    autoReconnect: boolean
    nativeWebSocket: WebSocket
    textEncoder: TextEncoder
    channels: (undefined | WebSocketChannel)[]
    channelCnt: number
    webSocketOpenPromise: Promise<void>
    webSocketOpenResolve: undefined | (() => void)
    webSocketOpenReject: undefined | ((msg?: string) => void)
    onNoBackendConnection: (reconnect: boolean) => void

    Called when connection to backend could not be established.

    Type Declaration

      • (reconnect: boolean): void
      • Parameters

        • reconnect: boolean

          defines if the (auto)reconnect or initial connection is failing.

        Returns void

    debugEnabled: boolean

    Methods

    • Allows attachment of events to the underlying WebSocket

      Type Parameters

      • K extends keyof WebSocketEventMap

      Parameters

      • type: K
      • listener: (this: WebSocket, ev: WebSocketEventMap[K]) => unknown
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Allows remove of events to the underlying WebSocket

      Type Parameters

      • K extends keyof WebSocketEventMap

      Parameters

      • type: K
      • listener: (this: WebSocket, ev: WebSocketEventMap[K]) => unknown
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Is WebSocket readyState set to open

      Returns boolean

    • Sends a binary message over a Channel

      Parameters

      • channelNumber: number
      • data: ArrayBufferView | ArrayBufferLike

      Returns void

    • Sends command to the server to close the Channel. Clean

      Parameters

      • channel: number

      Returns void

    • create a new channel within the WebSocket.

      Parameters

      • request: ServiceChannelRequest

      Returns Promise<WebSocketChannel>

    • Creates a TlsSocket Provider to an specific Service behind the WebSocketGateway.

      Parameters

      • backendServiceRequest: ServiceChannelRequest

        Identify the Service name, so that the WebSocketGateway can init the route.

      • tlsHostname: string
      • tlsCertificateAuthorityPem: string
      • tlsOptions: TlsWebSocketOptions

      Returns TlsWebSocketProvider