Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Socket

Index

Constructors

constructor

  • new Socket(url: string): Socket

Properties

Private callIdIncr

callIdIncr: number = 0

Private callbacks

callbacks: object

Type declaration

  • [key: number]: any

Private connectedSocketPromise

connectedSocketPromise: Promise<any> = null

Private url

url: string

Methods

Private getConnectedSocket

  • getConnectedSocket(): Promise<any>

invoke

  • invoke(method: number, request: ArrayBuffer): Promise<SocketResponse>
  • Byte layout of rpc invocation


    field magic callid method payload
    size 4 4 2 N

    Parameters

    • method: number
    • request: ArrayBuffer

    Returns Promise<SocketResponse>

Private onMessage

  • onMessage(message: any): void
  • Byte layout of rpc response


    field magic callid type payload
    size 4 4 1 N

    The type field is either byte:0 (success) or byte:33 (failure). In case of success payload is response object, in case of failure is error object and needs to be decoded with error decoder.

    Parameters

    • message: any

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc