MCPcopy
hub / github.com/wechaty/wechaty / wsOnClose

Method wsOnClose

src/io.ts:420–430  ·  view source on GitHub ↗
(
    ws      : WebSocket,
    code    : number,
    message : string,
  )

Source from the content-addressed store, hash-verified

418 }
419
420 private wsOnClose (
421 ws : WebSocket,
422 code : number,
423 message : string,
424 ): void {
425 if (this.state.on()) {
426 log.warn('Io', 'initWebSocket() close event[%d: %s]', code, message)
427 ws.close()
428 this.reconnect()
429 }
430 }
431
432 private reconnect () {
433 log.verbose('Io', 'reconnect()')

Callers 1

initWebSocketMethod · 0.95

Calls 2

reconnectMethod · 0.95
onMethod · 0.80

Tested by

no test coverage detected