Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ElectronWebSocketConnectionProvider

Customized connection provider between the frontend and the backend in electron environment. This customized connection provider makes sure the websocket connection does not try to reconnect once the electron-browser window is refreshed. Otherwise, backend resources are not disposed.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected channelIdSeq

channelIdSeq: number = 0

Protected Readonly channels

channels: Map<number, WebSocketChannel> = new Map<number, WebSocketChannel>()

onIncomingMessageActivity

onIncomingMessageActivity: Event<void> = this.onIncomingMessageActivityEmitter.event

Protected Readonly onIncomingMessageActivityEmitter

onIncomingMessageActivityEmitter: Emitter<void> = new Emitter()

Readonly onSocketDidClose

onSocketDidClose: Event<void> = this.onSocketDidCloseEmitter.event

Protected Readonly onSocketDidCloseEmitter

onSocketDidCloseEmitter: Emitter<void> = new Emitter()

Readonly onSocketDidOpen

onSocketDidOpen: Event<void> = this.onSocketDidOpenEmitter.event

Protected Readonly onSocketDidOpenEmitter

onSocketDidOpenEmitter: Emitter<void> = new Emitter()

Protected Readonly socket

socket: ReconnectingWebSocket

Protected stopping

stopping: boolean = false

Do not try to reconnect when the frontend application is stopping. The browser is navigating away from this page.

Methods

Protected createChannel

Protected createLogger

  • createLogger(): Logger

createProxy

Protected createWebSocket

  • createWebSocket(url: string): ReconnectingWebSocket

Protected createWebSocketUrl

  • createWebSocketUrl(path: string): string

Protected fireSocketDidClose

  • fireSocketDidClose(): void

Protected fireSocketDidOpen

  • fireSocketDidOpen(): void

Protected handleIncomingRawMessage

  • handleIncomingRawMessage(data: string): void

listen

onStop

  • onStop(): void

openChannel

Protected tryReconnect

  • tryReconnect(): void

Static createProxy

  • createProxy<T>(container: Container, path: string, arg?: undefined | object): JsonRpcProxy<T>