MCPcopy Create free account
hub / github.com/ptmt/react-native-macos / handleSendBroadcast

Function handleSendBroadcast

local-cli/server/util/messageSocket.js:73–89  ·  view source on GitHub ↗
(broadcasterId, message)

Source from the content-addressed store, hash-verified

71 }
72
73 function handleSendBroadcast(broadcasterId, message) {
74 const forwarded = {
75 version: PROTOCOL_VERSION,
76 method: message.method,
77 params: message.params,
78 };
79 for (const [otherId, otherWs] of clients) {
80 if (otherId !== broadcasterId) {
81 try {
82 otherWs.send(JSON.stringify(forwarded));
83 } catch (e) {
84 console.error(`Failed to send broadcast to client: '${otherId}' ` +
85 `due to:\n ${e.toString()}`);
86 }
87 }
88 }
89 }
90
91 wss.on('connection', function(clientWs) {
92 const clientId = `client#${nextClientId++}`;

Callers 1

attachToServerFunction · 0.85

Calls 3

errorMethod · 0.65
sendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…