Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebSocketChannel

Hierarchy

Implements

  • IWebSocket

Index

Constructors

constructor

  • new WebSocketChannel(id: number, doSend: (content: string) => void): WebSocketChannel

Properties

Protected Readonly closeEmitter

closeEmitter: Emitter<[number, string]> = ...

Protected closing

closing: boolean = false

Protected Readonly doSend

doSend: (content: string) => void

Type declaration

    • (content: string): void
    • Parameters

      • content: string

      Returns void

fireError

fireError: (reason: any) => void = ...

Type declaration

    • (reason: any): void
    • Parameters

      • reason: any

      Returns void

Protected fireMessage

fireMessage: (data: any) => void = ...

Type declaration

    • (data: any): void
    • Parameters

      • data: any

      Returns void

Protected fireOpen

fireOpen: () => void = ...

Type declaration

    • (): void
    • Returns void

Readonly id

id: number

Protected Readonly toDispose

toDispose: DisposableCollection = ...

Static wsPath

wsPath: string = '/services'

Methods

Protected checkNotDisposed

  • checkNotDisposed(): void

close

  • close(code?: number, reason?: string): void

dispose

  • dispose(): void

Protected fireClose

  • fireClose(code: number, reason: string): void

handleMessage

  • handleMessage(message: Message): void

onClose

  • onClose(cb: (code: number, reason: string) => void): Disposable

onError

  • onError(cb: (reason: any) => void): void

onMessage

  • onMessage(cb: (data: any) => void): void

onOpen

  • onOpen(cb: () => void): void

open

  • open(path: string): void

ready

  • ready(): void

send

  • send(content: string): void

tryClose

  • tryClose(code?: number, reason?: string): void