MCPcopy
hub / github.com/remy/jsconsole / send

Method send

lib/es.js:27–44  ·  view source on GitHub ↗
(id, body)

Source from the content-addressed store, hash-verified

25 }
26
27 send(id, body) {
28 const res = this.sessions[id];
29 if (res && res.connection && res.connection.writable) {
30 this.eventId++;
31 res.locals = {
32 eventId: this.eventId,
33 body,
34 id,
35 };
36 res.write(`data: ${body}\neventId:${this.eventId}\n\n`);
37
38 if (res.xhr) {
39 res.end(); // lets older browsers finish their xhr request
40 }
41 } else {
42 delete this.sessions[id];
43 }
44 }
45
46 ping(id) {
47 const res = this.sessions[id];

Callers 2

index.jsFile · 0.80
app.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected