MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / send

Method send

packages/server/src/ws/connection.ts:708–718  ·  view source on GitHub ↗
(message: unknown)

Source from the content-addressed store, hash-verified

706 }
707
708 public send(message: unknown): void {
709 if (this.closed) return;
710 if (this.socket.readyState !== this.socket.OPEN) return;
711 try {
712 this.socket.send(JSON.stringify(message), (err) => {
713 if (err) this.logger.warn({ err: String(err) }, 'ws send failed');
714 });
715 } catch (err) {
716 this.logger.warn({ err: String(err) }, 'ws send threw');
717 }
718 }
719
720 public close(code = 1000, reason?: string): void {
721 if (this.closed) return;

Callers 15

constructorMethod · 0.95
onClientHelloMethod · 0.95
syncSessionsMethod · 0.95
onSubscribeMethod · 0.95
onUnsubscribeMethod · 0.95
onWatchFsAddMethod · 0.95
onWatchFsRemoveMethod · 0.95
onAbortMethod · 0.95
onTerminalAttachMethod · 0.95
onTerminalDetachMethod · 0.95
onTerminalInputMethod · 0.95
onTerminalResizeMethod · 0.95

Calls 2

sendMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected