Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TestWebSocketChannel

Hierarchy

Implements

  • IWebSocket

Index

Type aliases

Static Message

Constructors

constructor

  • new TestWebSocketChannel(__namedParameters: { path: string; server: Server | Server }): TestWebSocketChannel

Properties

Protected Readonly closeEmitter

closeEmitter: Emitter<[number, string]> = new 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

Readonly id

id: number

Protected Readonly toDispose

toDispose: DisposableCollection = new DisposableCollection(this.closeEmitter)

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

fireError

  • fireError(): void

Protected fireMessage

  • fireMessage(): void

Protected fireOpen

  • fireOpen(): 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