MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / send_message

Method send_message

webiojs/src/session.ts:133–146  ·  view source on GitHub ↗
(msg: ClientEvent, onprogress?: (loaded: number, total: number) => void)

Source from the content-addressed store, hash-verified

131 }
132
133 send_message(msg: ClientEvent, onprogress?: (loaded: number, total: number) => void): void {
134 if (this.closed())
135 return error_alert(t("disconnected_with_server"));
136
137 if (this.ws === null)
138 return console.error('WebSocketWebIOSession.ws is null when invoke WebSocketWebIOSession.send_message. ' +
139 'Please call WebSocketWebIOSession.start_session first');
140 this.ws.send(JSON.stringify(msg));
141
142 if (onprogress)
143 this.start_onprogress(onprogress);
144
145 if (this.debug) console.info('<<<', msg);
146 }
147
148 send_buffer(data: Blob, onprogress?: (loaded: number, total: number) => void): void {
149 if (this.closed())

Callers

nothing calls this directly

Calls 5

closedMethod · 0.95
start_onprogressMethod · 0.95
error_alertFunction · 0.90
tFunction · 0.90
sendMethod · 0.80

Tested by

no test coverage detected